I am using Asp.NET MVC 3. In one particular use case, I need to present the user with three forms one after the other. On each form the user can upload up to 5 files, each file being a maximum of 2 MB. So the combined file size can go up to 30MB if a particular user uploads all files in every form. In some cases depending on other selections on the page the user may not have to pass through all the three forms. At the end of it all there will be a submit button that inserts all data into a table.
My question is: what is the best way to manage the files uploaded on each page along with their associated data per page until the user hits submit on the final page. I am thinking keeping it in session is not a good idea as this server can have upto 100 simultaneous users, which will mean a lot of memory required on the server. Am I wrong in that assumption? If not using sessions to store all that data, what are my other options?
Thanks in advance.
Store your files in a “in progress” table. It is okay to save state in workflow scenarios.
When they complete the process, move the data to the permanent resting place.
If they cancel the upload process, you can delete the data from the staging environment.
If they are not logged in, you can delete them when the session expires. Make sure you put a date stamp on the records so that you can run cleanup scripts periodically.