I need to know how to post files from an input to an asp mvc4 controller. Please I would thanks help
Asked
Active
Viewed 428 times
-2
-
4http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx – Ravi Gadag Apr 01 '13 at 12:52
-
a search on google get you lacks of results – Karthik Chintala Apr 01 '13 at 13:30
-
but i need code example, no plugins – pedritin Apr 01 '13 at 13:33
1 Answers
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