0

I want to implement File Upload in MVC 4 that should run across all browsers at least ranging from IE 8 or later, Chrome, and FF.

The main requirement is to have AJAX supported, as I want to implement it inside AJAX.BeginForm.

I know a solution for HTML.BeginForm, but that doesn't work for AJAX based form.

Any help or guidance on this one will be much appreciated.

Thanks

tereško
  • 57,247
  • 24
  • 95
  • 149
Nirman
  • 6,529
  • 18
  • 68
  • 131
  • The [answer](http://stackoverflow.com/a/8758614/143008) to the [How can I upload files asynchronously with jQuery?](http://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery) might be helpful to you. – HOCA Nov 14 '13 at 01:33

1 Answers1

0

File uploads and Ajax are incompatible, but that isn't to say you can't do it. Look at using a library like Jquery Form which uses a few tricks to make it seem as though your classic Ajax request has occurred.

I normally decouple my file uploads and form posts. I allow people to upload the files, then on the return I push the identifier of the file into the form using a hidden input field.

Khalid Abuhakmeh
  • 10,551
  • 10
  • 51
  • 75