08-23-2011 2:19 PM
hi all
can you please tell me how to convert a MIME type to doc type? Any function module or method or BAPI? please
08-23-2011 2:27 PM
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
08-23-2011 2:49 PM
08-23-2011 2:59 PM
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
08-23-2011 3:31 PM
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.
08-24-2011 8:09 AM