-2

I need to know how to post files from an input to an asp mvc4 controller. Please I would thanks help

Sarah
  • 1,895
  • 2
  • 21
  • 39
pedritin
  • 47
  • 2
  • 10

1 Answers1

0

You cannot use AJAX to send files to the server. This is possible only in browsers that support the HTML5 File API. As an alternative there are plugins that you could use such as jQuery.form, Uploadify, Fine Uploader, BlueImp file upload which will test the capabilities of the client browser and fallback to other techniques if it doesn't support HTML5 File API.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • I don't want to use a plugin, i need a code example for c# asp.net mvc 4 – pedritin Apr 01 '13 at 19:41
  • As I already mentioned in my answer it is not possible to upload files using AJAX. If you want to upload files with a standard form you may take a look at this post: http://stackoverflow.com/questions/5193842/file-upload-asp-net-mvc-3-0/ – Darin Dimitrov Apr 01 '13 at 20:32