Bill White
Bill White

Reputation: 31

asp.net mvc Upload File ajax

Hi ive got an mvc form with a fileupload functionality. Ive got an action that accepts an file and extracts thumbnails from it, after which the user can select the images and then proceed to submit the form. How can post the initial file via ajax, bearing in mind, this is not the final submission on the form and I want to retain user input. ie no postback Thanks

Upvotes: 3

Views: 2682

Answers (2)

Bradley Mountford
Bradley Mountford

Reputation: 8273

I use the ajaxupload plugin for jQuery. Lots of sample code is provided on the site. From the site:

[The] plugin creates invisible file input on top of the button you provide, so when user clicks on your button the normal file selection window is shown. And after user selects a file, plugin submits form that contains file input to an iframe. So it isn’t true ajax upload, but brings same user experience.

Upvotes: 2

JustLoren
JustLoren

Reputation: 3234

Browsers don't allow the uploading of files via ajax. There are several good workarounds, however.

Upvotes: 0

Related Questions