Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Download mutiple images

Hi Experts,

I have uploaded images and saved in table in xstring format.

Multiple images may be uploaded for 1 entry.

I want to download those images and display them as an attachment or smthng, but basically the user should be able to view all the images uploaded for an entry.

I tried using file_download for this purpose, but it shows on 1 image not multiple.

Any help would be appreciated.

Thank You.

Former Member
replied

I was asked in email to provide an example of how to use the ZIP library:

data izip type ref to cl_abap_zip.
 create object izip.
  loop at images assigning <wa_image>
    izip->add( name = <wa_image>-img_name
                content = <wa_image>-content ).
 endloop.
    l_xstream = izip->save( ).

In this example, each image is added to the ZIP file (and compressed). You then get the full binary content for the zip file back into the i_xstream variable via the izip->save() call. This i_xstream is then what you download.

cl_wd_runtime_services=>attach_file_to_response(
      i_filename      = l_name
      i_content       = l_xstream
      i_mime_type     = l_mimetype ).

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question