0

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 ?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
kjyothiraditya
  • 33
  • 1
  • 10
  • 2
    There can be also some answers in the same question at [SCN](https://answers.sap.com/questions/12706388/send-more-than-1-file-in-http-response.html) – Sandra Rossi Jun 07 '19 at 10:49
  • Yes Sandra, as some people would also be active here and it is urgent , i thought of putting it here . – kjyothiraditya Jun 10 '19 at 01:51
  • Possible duplicate of [Send multiple files in HTTP response](https://stackoverflow.com/questions/56542388/send-multiple-files-in-http-response) – Suncatcher Jul 05 '19 at 18:53

0 Answers0