Downloading big zip file in the background using a process
Application Type
Traditional Web

Below is a POC of what I actually want to do but instead of using "download" , I want to it to work in the background using a process. Once the background process completes it downloads the file.

How can I achieve this ?

So basically the oml below downloads a zip file called users.zip inside it , is another zip file. Inside the zip file is an excel. So I do understand how you can zip files and all.

My use case:


1)Assume I have multiple users with many attachments.
2)The attachments can be of different extension types i.e being pdf,png,word files and so on.
3)I want the file zip file to be in the format attached in the oml below. 

Format of MainZip file

(MainZip->(User1->all attachment),(User2->all attachments)................(UserN->all attachments)

MainZip

So basically the main zip consists of many zip files where each zip file inside the main zip file consists of all the attachments of that User. There can be numerous Users. Refer to oml to find attached thing I'm talking about

4) The Main point, assume I have 10 to 20 users , where each users has 10-15 attachments. Using a screen action will probably freeze my UI which I want to avoid. I want a background process to do the work asynchronously once it completes download  the MainZip. 


All done in the background Please note.


Any help will be much appreciated.




ZipButton.oml

mvp_badge
MVP
Solution

Hi Craig,


Ok, so you need the selection first.

When the user clicks the button, you can save its selections and launch a Light BPT to process the file and save it in the database the zip. In the end of the Light BPT, you can send a notification to the user, using for instance Firebase forge component (see documentation here on how to set it up).

If everything is set up correctly, you will have a handler being triggered on the screen / layout when the download is over and you will just have to download the file.


Kind Regards,
João

mvp_badge
MVP

Hi Craig,


Have you tried to, in background, process the files and generate your zip and save the zip per user in the database?

In this way, when the user clicks the download button, you just download the zip in database.


If you scale this for thousands of users, you will need to a) purge your database within a timeframe since binaries occupy considerable space in DB or b) save your files in a blob storage elsewhere, like azure blob storage for instance.


Kind Regards,

João

Hello João 



The thing we already have a table , where attachments are stored.


The use case for this particular scenario is a person(agent) who is charge of a set of users can view these users , presuming there arises some task he needs all the documents to be obtained for download.
The agent selects like a dropdown which lets say 10 , so first ten users assigned to him all their documents will be downloaded according to an user in a separate zips as mentioned above


Have you tried to, in background, process the files and generate your zip and save the zip per user in the database?------The thing if I knew value the agent was gonna select this would make sense


I honestly need an idea for a bulk download process , don't much above bpts but since it's a large number of documents I can't use a screen action , wait for it compress the files and then download.

For instance should the process run and store files in a separate entity , but assume that's the case when should I trigger the process i.e launch the process in the preparation or after the button is clicked and so.Also what happens if the process is still running and then agent clicks download.

Any idea will help. Thanks for your input João.

Regards Craig

mvp_badge
MVP
Solution

Hi Craig,


Ok, so you need the selection first.

When the user clicks the button, you can save its selections and launch a Light BPT to process the file and save it in the database the zip. In the end of the Light BPT, you can send a notification to the user, using for instance Firebase forge component (see documentation here on how to set it up).

If everything is set up correctly, you will have a handler being triggered on the screen / layout when the download is over and you will just have to download the file.


Kind Regards,
João

Hello João  

Thank you for you input I followed your steps and achieved this.

Could please help with another problem I'm facing. I understood the whole process and all but instead of telling the user the download is ready I just send them an email. With the structure above.

The issue I'm facing after setting mime to

I received the desired structure and all , I can view via the browser


 

I have also tried application/octet-stream, wasn't able to view it the browser (Picture above) and upon downloading received the same results below


But after downloading it , It downloads with a file extension( attached below)



I want to achieve this (attached below)



Warm Regards
Craig

I managed to get it by changing the name to Users.zip

João you have been really helpful, imma mark your above reply as the answer and close this.

Regards Craig


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.