Pregunta

everyone I am a student and new to .NET and specially MVC3 development.

Currently in one of my projects part there is a form that includes few text fields and two file inputs.

Keeping in view that the file uploaded could be of large sizes I want to use an Asynchronous file uploader which can show the progress of the file being uploaded so that user don’t feel like hanged up and stucked while the files being uploaded at the back, I want to keep user engaged and informed about the file upload progress. I search for few possible options such as uploadify but didn’t find much success in using them.

  • I want to know are there any useful .net/MVC plugins that can be used to asynchronously upload those files?

  • It would be best to have some options such as file extension/size check in it.

Thank you!

¿Fue útil?

Solución

technically, multiupload with some progress indicator is not server side functionality, so you cant get "MVC plugin" to do that. You must implement some client-side solution, usually based on Flash, Silverlight, HTML5 or so - there are many of them. On server side you must then just receive that file as usual (or merge it from "chunks" if it is send in "split" mode - see tutorials on this).

So more like "MVC plugin" you need to search for "Jquery plugin" or "multiupload" in general.

For example, look here : http://superdit.com/2010/06/29/10-jquery-ajax-file-uploader-plugins/

Otros consejos

Uploadify is really a good option, in my opinion, if you dont mind the flash. My company is using it on one of our sites right now and it works really well. There are very few other options out there to actually limit the file types the user can choose. Hopefully, there will be some good HTML5 uploaders out soon that can handle this, but as far as I know there are not any currently. I would love to be proven wrong though. Also, even if there was a suitable HTML5 uploader, you may not be able to use them if your website has users that use browsers that do not support HTML5.

Update: You can also limit file size, and upload multiple files at a time using CTRL + clicking all the files to be uploaded.

Update: Regarding the 'HTTP Error', I have thought about this for a little while. The only time I have ever experienced an error such as this, was in the case that the user was not authenticated. For example, they went directly to the page without logging in. This should not be possible on your site, but in just testing with the uploader initially on pages, we were not forcing the user to be authenticated and this error appeared. Once we forced the user to be authenticated (sign-in) before viewing the page, this error was resolved.

This jQuery uploader is looking really good and should also workout with any version of asp.net mvc

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top