views:

113

answers:

5

Hi I was just wondering if its possible to do an ajax post a file in asp.net mvc, basically i have a form with two buttons, one of the buttons extracts images for the selected document and displays them for the user to choose thumbnails for the document he is about to upload. The usee then fills out the rest of the form and then saves the document.

With the image extraction, I was owndering if it was possible to do that as an ajax post. The other submit button can work as a normal http post Thanks

A: 

there sure is. If you use the ajaxForm plugin you should be able to do it no problem. I've implemented this on my site and it works very well. Here's and example: http://jquery.malsup.com/form/#file-upload

lomaxx
I have tried it but the it does not postback or do an ajax post on my form
mike
A: 

You may take a look at the jQuery Form plugin which allows you to ajaxify forms that contain file inputs.

Darin Dimitrov
+1  A: 

Using web controls under MVC application is a real mess. I suggest you to try this sample project. ( Also, there are many useful MVC samples in there )

BigbangO
A: 

Flash upload works the best if its an option as it gives you more flexibility on the UI side. There are a lot of jQuery plugins that will do this. Uploadify is the one I like best. If you can't use Flash, check out this post on how to do jQuery file uploads in asp.net mvc without flash, which uses the jQuery form plugin mentioned previously.

thekaido