cancel
Showing results for 
Search instead for 
Did you mean: 

download a file

Former Member
0 Kudos

Hi experts,

I need to download a file in wd. I searched the forum and so far i found mostly for upload.

and i need to use cl_wd_file_download. There is a method get_data. But I don't know how to initialize the reference.

A sample code or any hint will be useful downloading a file using this class.

Thanks in advance.

Tenzin

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

used the ui element file donwload

Former Member
0 Kudos

Hi experts,

Thanks for the support. Now I'v successfully used file download ui element and its opening the same session.

warm Regards

Tenzin

Former Member
0 Kudos

Hi,

The link wasn't of much help. I need to download a mime file which is already available in the repository.

Kindly can you provide any other assistance regarding that. Is it madatory to have the download file ui element.

Any assistance will be helpful

Thanks Tenzin

Former Member
0 Kudos

Hi,

Yes you ahve to use upload or download ui elements to upload or download.

By using this you can upload or download any type of files.

use.. CL_MIME_REPOSITORY_API .

Please check this...

Cheers,

Kris.

Former Member
0 Kudos

Hi Kissnas,

I am aware of this downloading from the mime, once downloaded how do i use the cl_wd_runtime_services=>attach_file_to_response.

Currently what happens is when i try to open a new url for the downloaded file, its trying to open a new session and i am getting the error 400 session not found. is there a solution for this issue.

Warm Regards

Tenzin

Former Member
0 Kudos

Hi,

once downloaded how do i use the cl_wd_runtime_services=>attach_file_to_response.

When you get the content of the mime into lv_data of type xstring, pass that to the i_content like below.

cl_wd_runtime_services=>attach_file_to_response(

i_filename = lv_file_name

i_content = lv_data

i_mime_type = 'text/plain'

i_in_new_window = abap_false

i_inplace = abap_false ).

Former Member
0 Kudos

Hi Bakaran,

With this method i want to open a new window but with the same instance.

The generated url to download the file should point on the same instance, so i don't have this session out issue.

Some one has recommended me to use cl_wd_file_download... if you have any code related with using this will be helpful.

Thanks

Tenzin

Former Member
Former Member
0 Kudos

I think you can use

i_in_new_window = abap_true

i_in_place = abap_false

this will bring the new window. I am not sure about your problem with session. You get a popup asking you to save the file in desired place. Same as another file you would download from internet. It is just a browser function.

I think for the file download there a link already provided in this forum.

Former Member
0 Kudos

Hi Wang,

Please go through this wiki.. download and uplaod.

http://wiki.sdn.sap.com/wiki/display/WDABAP/UploadandDownloadfilesinWebdynproABAP

Cheers,

Kris.