I am creating an ICF handler class which reads file from application layer and I need to send the response back to sender with the files in the response. For this I am using MULTIPART format as below.
I am using ABAP as the programming language and we are on SAP_ABA 702 0010 version and do not have Gateway component yet.
server->response->set_header_field( name = 'Content-Type' value = 'multipart/form-data'). "#EC NOTEXT
lo_multipart = server->response->add_multipart( ).
filename = '/file1.jpg'.
CONCATENATE 'form-data; name="file"; filename="' filename '"' INTO lv_header_value.
lo_multipart->set_header_field( name = if_http_header_fields=>content_disposition
value = lv_header_value ).
server->response->set_data( data = attach_xstring ).
This works fine for 1 file which automatically downloads the file when browser is used. But I need to send 2 separate files in the body and to demarcate them with some information like file name, file extension and so on.
Could you please guide/help me on how to fix this ?