on 12-06-2013 6:19 PM
Good day experts I am using this class cl_wd_runtime_services to download a Word file into a WebDynpro applications, operating correctly but after I download the file has 0 kb when the actual size is 25kb.
Please help me I hope, this is the code I am using:
DATA: lv_filename TYPE string,
lv_ctype TYPE string,
lv_content TYPE xstring.
lv_filename = 'Anexar.docx'.
lv_ctype = 'pdf'.
cl_wd_runtime_services=>attach_file_to_response(
EXPORTING i_filename = lv_filename
i_content = lv_content
i_mime_type = lv_ctype
i_in_new_window = abap_true ).
Thanks
Best regards.
Hi Brujo,
As suggested by Srinivass, use function module SDOK_MIMETYPE_GET to get mimetype based on file extenstion.
In your case: for "DOCX", mime type should be "application/octet-stream".
The issue here is with lv_content i.e. the content is empty. Hence it is having 0kb.
It should be having file content filled.
Get the content of your file in xstring format into lv_content.
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use fm SDOK_MIMETYPE_GET to get mime type for given file extension and use that in
cl_wd_runtime_services=>attach_file_to_response. So doc extension file mime type would be 'application/msword',for pdf 'application/pdf'.Minme type is customizable,so use above function module to get mime type.
Regards,
Sreenivas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.