I have a download button in the user interface, the user clicks on it and downloads 3 files in zip format.
Files do not need to be available when the download button is clicked, because the process may take a long time to place the files in a particular location on the server.
The files will be in the following format
fichier1_1555077233.csv file2_1555077233.csv file3_1555077233.csv
So, whenever a user clicks the button, I can get the last file based on the timestamp.
I'm trying to know where exactly should I generate this timestamp? This timestamp will be included with the file name at the time of file generation.
The problem with this approach is that how would I know the timestamp value if a user turns off his computer and later returns to search for files after clicking the download button?
2) Do I have to let my Java-based backend web service generate the timestamp as soon as it is called from the UI?
The problem with this approach is that I will have to access this timestamp on the side of the UI so that when a user clicks on the download button, I can make a request based on the file name and the let the user know.
whether the file exists or not. One approach is to get this Java Web Service timestamp in a JSON response, but it would only work if the user kept the browser open for a long time, which is not ideal.
Let's say that the user closes everything and comes back later. How should I handle this thing?
If there is anything more that I should do (which I think I should do) besides managing the generation of timestamps, please let me know. Thank you