Ideas on getting files on the UI

In the following scenario, I am wondering what would be the best way to get the files from the server.

I’ve a download button in the UI, the user clicks on it, it could take 2-3 hours for the backend to process upload the files(3-4 files) in a specific directory on the server.

  1. What would be an ideal way to display files on the UI. I mean how should I get it from the specified directory from the server. Since there are 2-3 files that I am trying to get, I am wondering how making a web service call to the specified location would make sense since a REST call might just give me a JSON or XML response? Is there any other approach that I am missing here?

  2. For displaying a file, would showing a HTML text area and then showing the files in it be a good idea?I am not sure if this is even possible or if it’s a correct approach. The user should be able to download all the files in zip format.



Sorry, I didn’t understand.

He’s saying if you expect a 2-3 HOUR lag time between the user clicking a button and the file being available, it’s best to notify and/or send the user the file (or link) via email, because noone’s going to sit there with a spinning pinwheel for 2-3 hours.

Basically, establish a simple Job Queue system: (Some of this functionality may be overkill/undesired, but for the purposes of description, are included)
User clicks button.
Server receives button click, begins processing files.
Server simultaneously responds to the user, informing the browser that it has received the request, and giving it a Job ID number.
User is now free to do whatever they want while the server processes.
During processing time, User can query the server for the status of the Job based on ID number.
Once the job is completed, Server issues an email to the user notifying them.
User can now query the server for the status of the Job using the ID number, and be given the files in question.

I see. For 2-3 hour delay, I am handling such issue using Java Message Service (JMS). With JMS I am able to handle asynchronous requests. Email is the thing I am trying to figure out as well.

By any chance you have any idea about how should I get the files once it’s there on the server. Thanks

This is right. I’ve already talked about this before.

A system I am rewriting does something similar. It was solved by sending the reports to the user’s email because the reports are very time consuming. There is no need for a heartbeat or websocket because the data is handled outside the web client.

Right. But here I am trying to figure out about retrieving files. I mean let’s say user returns after 2-3 hours and then clicks on download button, he/she should immediately get the files since the files are already present on the server at specified location. So, this is the part where I am trying to get some ideas.

Store them as a key name and let the user download them from wherever you’re storing them. There’s not really anything to that.

Thanks. I am wondering what would be the best approach to download the file using jQuery or HTML5 download attribute since I need to download 3 files in a zipped format.

Somewhat similar to what they have done here :

Not sure how they are doing that. Since I have 3 files, I would want them to be in zip format.


By key name, were you referring to current timestamp or something unique identifier? If I decide to store it using current timestamp, would it be possible to retrieve it easily at the time of download?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.