Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

convert MIME type to doc type

pradeep_grandhi
Active Participant
0 Kudos

hi all

can you please tell me how to convert a MIME type to doc type? Any function module or method or BAPI? please

5 REPLIES 5

Former Member
0 Kudos

Hi ,

Can you try the below code:

If you try to upload DOCX and ODT files, symfony will recognise them as a ZIP archive. To corrrect this and the OpenOffice DOC mimetype problem, add the 'mime_type_guessers' option to sfValidatorFile:

view plaincopy to clipboardprint?

$this->setValidator('filename', new sfValidatorFile(array(

'max_size' => ...,

'path' => ...,

'mime_type_guessers' => array('guessFromFileinfo'),

'required' => ...,

...

Moderator message: do not copy/paste, if caught again, your ID will be deleted.

http://www.google.com/search?q=IfyoutrytouploadDOCXandODTfiles

Edited by: Thomas Zloch on Aug 23, 2011 4:38 PM

0 Kudos

can u be a bit clear...

i havent understood anything

0 Kudos

Hi Pradeep,

You have to convert the MIME object into string formate first . Plz use the below code.

You need to read the Mime object, and convert it from xstring into a SOLI table. The following code makes that easy and quick.

REPORT zzzzzzz.

DATA:

mime_repository TYPE REF TO if_mr_api,

mime_xstring TYPE xstring,

mime_length TYPE i,

mime_soli TYPE soli_tab,

url TYPE string VALUE '/SAP/PUBLIC/BC/mymime.doc'.

mime_repository ?= cl_mime_repository_api=>get_api( ).

CALL METHOD mime_repository->get

EXPORTING

i_url = url

IMPORTING

e_content = mime_xstring.

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

EXPORTING

buffer = mime_xstring

IMPORTING

output_length = mime_length

TABLES

binary_tab = mime_soli.

The MIME object is now in mime_soli ready for SAP Office processing

Moderator message: see above.

http://www.google.com/search?q=%22Thefollowingcodemakesthateasyand+quick%22

Edited by: Thomas Zloch on Aug 23, 2011 4:43 PM

0 Kudos

hi devireddy,

the get method is returning nothing in mime_xstring when i am using the same code as above. I used the same URL as you used.

pradeep_grandhi
Active Participant
0 Kudos

This is the function module:

SA_KW_RFC_FILENAME_EXT_GET