28
Views
10
Comments
Solved
Download multiple file
Question

Hi Team,


I need to download multiple files in a single button click.

I dont want to zip files . I need to download seperately.

Please help



Thanks

Rank: #143
Solution

Hello Pasupathi,

For Traditional Web, you can create an extra screen only for downloading purposes and call it multiple times. This screen won't be visible for your application.


For this example, I have an entity (called File) just to store the files. They are stored in the Database as Base 64, but they can be stored as Binary Data as well.

Basically, I created a screen where its Preparation ends up with a Download widget. This screen receives an Id, fetches the Database for that specific file, transforms it to Binary Data and goes directly to the Download:

Then I need to call this "hidden" Screen multiple times from another screen (my application screen). And I was able to do this using RunJavaScript action from HTTPRequestHandler extension.

So I have my application screen where I have a button that is going to loop my list of files and call that RunJavaScript action to open my "hidden" screen (passing my correct FileId) in order to execute multiple downloads. I'm using Window Open() JavaScript method.

"
window.open(""https://rbarradas.outsystemscloud.com/MultipleFileDownloadTraditional/DownloadScreen.aspx?FileId=" + GetFiles.List.Current.File.Id + """);
"


Please refer to attached OML file.

I hope that this example gives you some ideas :)


Kind regards,

Rui Barradas

MultipleFileDownloadTraditional.oml

Rank: #143

Hello Pasupathi,

Do you have those files stored in the database?

Are you working with Traditional or Reactive Web?


Kind regards,

Rui Barradas

Rank: #143

Hello again Pasupathi,

I just did a very quick example for a Reactive Web Application on how to download multiple files.

Note that for this example, files are stored as resources.

You can create a single DownloadFile screen action which receives a BinaryData and a Name and simply executes the download.

Then you should be able to call this action multiple times in another Screen Action.

Please refer to attached OML file.


I hope this example gives you some ideas :)


Kind regards,

Rui Barradas

MultipleFileDownload.oml

Hi Pasupathi,


Check if below options works for you.

If you are trying to download the Excel sheets then try to keep them in one Excel File and download. 

OR

Else  Zipping all files into one file and download it.(Use Zip Exten.)


Regards,

Rama

Rank: #143
Solution

Hello Pasupathi,

For Traditional Web, you can create an extra screen only for downloading purposes and call it multiple times. This screen won't be visible for your application.


For this example, I have an entity (called File) just to store the files. They are stored in the Database as Base 64, but they can be stored as Binary Data as well.

Basically, I created a screen where its Preparation ends up with a Download widget. This screen receives an Id, fetches the Database for that specific file, transforms it to Binary Data and goes directly to the Download:

Then I need to call this "hidden" Screen multiple times from another screen (my application screen). And I was able to do this using RunJavaScript action from HTTPRequestHandler extension.

So I have my application screen where I have a button that is going to loop my list of files and call that RunJavaScript action to open my "hidden" screen (passing my correct FileId) in order to execute multiple downloads. I'm using Window Open() JavaScript method.

"
window.open(""https://rbarradas.outsystemscloud.com/MultipleFileDownloadTraditional/DownloadScreen.aspx?FileId=" + GetFiles.List.Current.File.Id + """);
"


Please refer to attached OML file.

I hope that this example gives you some ideas :)


Kind regards,

Rui Barradas

MultipleFileDownloadTraditional.oml

Hi Rui,

Thanks for your help. it works for me.

When downloading, additional tabs opening and closing .Can we avoid this behavior?


Rank: #143

Hello Pasupathi,

I'm glad it is working for you :)

Unfortunately, we cannot avoid that behavior for the previous solution, because we are using the Preparation of the "hidden screen" to execute the download.


Kind regards,

Rui Barradas

Thanks for your help. I found that as a solution