Uploading multiple / large files

I have this page where user can upload documents (multiple documents, size limit is 10MB). This is a two step process. Step 1 has an input form. Step 2 is a preview page with a submit button.

How should I handle the scenario when the user closes the browser on the preview page without submitting the form? Should I save files to a temporary location after step 1? Is this a decent solution?

And what are the best practices in general for uploading (reasonably) large files?

Thank.

+3


source to share


3 answers


You can use a temporary folder to save files and copy files to their final location only when submitting the form.

It would be better to implement a garbage collector anyway. The garbage collector can empty the temp folder every night. But when using the garbage collector, if you have a way to identify the files that weren't uploaded (for example, if the row was added to the database on upload), you can put the files in their final location from the start and allow the garbage collector to remove them every night.



Uploading large files can be done with a jQuery UI plugin such as Uploadify: http://www.uploadify.com/ . You should note that it uses flash memory, which on the one hand is very good for downloading large files, but on the other hand it will not allow your application to support Apple computers like iPad.

0


source


Take a look at this:

http://www.codeproject.com/Articles/68374/Upload-Multiple-Files-in-ASP-NET-using-jQuery



Either way, you'll probably end up looking at a jQuery / AJAX control to do this.

+1


source


If the user leaves, then let them start working. Most likely they left for a good reason. If it fails, leave responsibility at their end. If you choose to save your data without sending it, it will allow attackers to use your storage.

You can also watch a process called chunking.

For a more detailed discussion of uploading files in mvc3 see this SO post: Uploading and Linking MVC 3 Files

0


source







All Articles