I have an HTML web form (pl/sql generated ) where users can enter a search criteria, hit "find" and the system will search the ORDERS (oracle 9i) and list a webpage with all the orders that were found. The user should be able to hit "Zip & Download" button which will dump each ORDER HTML page to a directory on the server, then ZIP all the files together and download ONE zip file to the user client machine. The download can be using a direct link to the server or using mod_plsql.
I am using a java stored procedure to call the UNIX zip command described in this link.
How would you best design this in terms of implementing concurrency controls in case "john" logs in and do a search/download and "mike" logs in and does another search/download.
Would you create one /tmp/ directory to dump all the files for all users and then ZIP all those order files into a unique zip filename?
or would you use one directory per user /tmp/john/, /tmp/mike/ and clean up the directory each time they press the button.
Can I also use the same zip file name or it has to be somehow unique.
Would you also call a direct link to the ZIP file on the filesystem,
Can you advise on the best way to implement this.