Download mutiple images
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.
Thomas Jung 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 ).