on 03-26-2010 3:16 AM
hi all:
As you know, WeyDynpor has provided upload/download UI element, but it seems that it only support one file upload/downlaod at the same time.The following is the API method to download one file in Webdynpro:
cl_wd_runtime_services=>attach_file_to_response(
EXPORTING
i_filename = lv_filename
i_content = lv_content
i_mime_type = lv_mine_type
i_in_new_window = abap_true
i_inplace = abap_false
* EXCEPTIONS
* others = 1
).
but if when use click one button, we want to provide user a html file plus 2 icons files which are used as this html file's resource file, then how to let user download these 3 files together at the same time?
one simple way is calling the download api (cl_wd_runtime_services=>attach_file_to_response) 3 times,
but it is very ugly that three popup windows are shown to let user select every file's download path, which is unaccepted.
So anyone know more convienient way to handle it?
thanks.
Hello Tony,
sorry - it's not supported in any standard UI element at the moment.
Your best bet is to build a flex island - that does have the ability to take multiple files - and get it to load them into your context.
Depending on your version - you also have the option of a silverlight island.
It would be nice if it was supported as standard - just in case anyone is listening!
Hope this helps,
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Zipping the files is a very good workaround.
>sorry - it's not supported in any standard UI element at the moment.
Actually there is a standard UI element that this can be done with as of 7.01. It is the ACFUpDownload. It does require writting your own HTTP handler to service the download - since ACFUpDownload doesn't communicate directly with your Web Dynpro session. However this can be done without too much difficulty. The ACFUpDownload does have the downside that it doesn't have a file open/save dialog (at least until 7.02) and it requires a security whitelist to control which directories are accessible.
For what you described Zip content is probably still the best approach, but just wanted to present alternatives for future consideration.
Hi,
I suggest you to zip the files and attach it to the response. Do the add file part for each of your files
"References
DATA lr_zip TYPE REF TO cl_abap_zip.
"Variables
DATA lv_zip_xstring TYPE xstring.
DATA lv_zip_name TYPE string.
DATA lv_file_content TYPE xstring.
DATA lv_file_name TYPE string.
"Create instance
CREATE OBJECT lr_zip.
"Add file
lr_zip_attachments->add(
EXPORTING name = lv_file_name
content = lv_file_content ).
"
lr_zip_attachments->save( RECEIVING zip = lv_zip_xstring ).
"Attach zip file to response
cl_wd_runtime_services=>attach_file_to_response(
EXPORTING i_filename = lv_zip_name
i_mime_type = 'ZIP/APPLICATION'
i_content = lv_zip_xstring ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.