on 10-06-2008 12:23 PM
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.
File download will only download one item at a time. If you want to download multiple items, you would need to use ZIP compression to place them all together in one binary string. You can use the class CL_ABAP_ZIP to do this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ).
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.