How to implement Blueimp jQuery file upload in ASP.NET

John L picture John L · Jan 18, 2012 · Viewed 13k times · Source

Trying to implement the Blueimp jQuery file uploader and am having a frustrating time making it work in my ASPNET MVC3 C# web-application. Its very difficult to determine which jquery and css includes are required (and which are not) when referring to the official documentation or Blueimp questions on this site.

Can anyone provide a working implementation of a bare-bones form containing a file input selector (not multiple files), a single "Upload" button, a single "Cancel" button, and a progress bar? After selecting a single file, clicking "Upload" should fire an AJAX call to "UploadFile" in FileController (which is already coded and working, and accepts an HttpPostedFileBase parameter) and update the progress-bar, without a form postback. There is also no requirement to add the file name to a list of files to be uploaded (as the Blueimp demo demonstrates), as the user will only be able to select a single file in this project.

Thanks to anyone kind enough to put me out of my misery on this one.

Answer

gsk picture gsk · Mar 19, 2012

This should help you: https://github.com/maxpavlov/jQuery-File-Upload.MVC3

A clean and simple implementation of blueimp fileupload v5.9 in ASP.Net MVC 3