Hi all,
i have a requirement to download different types of documents saved in server. All MS office documents are downloading correctly. it is supporting .xls files but .xlsx files are beiong saved and opened but with empty data, when opened in text document, it shows unrecognized characters(corrupted data)
i am using the below code.
1. FM to get the data in bianry format, file name and mome type.
2. then....
concatenate 'attachment;filename=' <filename> into lv_content_disposition_value .
loop at <binary data> into LT_CONTENT_BIN. " LT_CONTENT_BIN is of RAW(1022) type
CONCATENATE xstr LT_CONTENT_BIN-line INTO xstr IN BYTE MODE.
endloop.
me->response->set_data( data = xstr ).
me->response->set_header_field( name = 'Content-Type' value = lv_mimetype ).
me->response->set_header_field(
NAME = 'content-disposition'
VALUE = lv_content_disposition_value ).
navigation->response_complete( ).
the above code is written in Controller - do_request. no view is being called at the end. only the controller is available.
this is of high priority.. so please respond quickly.
thanks in advance.
Ajay.