Hello experts,
I'm having a problem with downloading .docx and .xlsx files from Webdynpro.
Situation: User uploads a document and it is saved to the network drive. Later on a user must be able to open this file/download this file in Webdynpro ABAP. To read the file into an XSTRING I use the statement:
OPEN DATASET x FOR INPUT IN BINARY MODE
This is succesfull, later on I retrieve the correct MIME type and size
FYI: With note 1237688 you can retrieve the latest Word 2007 mime types in your system
CALL FUNCTION 'SDOK_MIMETYPE_GET'
EXPORTING
extension = lv_extension
IMPORTING
mimetype = lv_mime_type.
XSTRLEN( ls_attachment-file_contents ).
For example .docx is mime type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Afterwards I pass these on to the FileDownload UI element or the following method
CL_WD_RUNTIME_SERVICES=>attach_file_to_response
Result: .docx or .xlsx download files are always corrupt - with Office 2010 you do have the option to try and recover the file -> and this works!
But our customer is using Office 2007 and this is not supported there so he only gets the message that the file is corrupt.
Can anyone else confirm this problem or help me with a solution? Thx!
Greetings,
Wouter