ASP.NET MVC Uploading Files

Data Entry Form Multipart

Any data entry form which includes a file upload must have the enctype set to "multipart/form-data", the first parameter is the method name, followed by the controller name.

Input type=file

The html input statement must have type="file" to provide the file upload dialog to appear. The name of the data value must match the input parameter in the controller method, in this example "uploadFile"

Controller Post Method

The controller method must contain a parameter of type HttpPostedFileBase and the name of the parameter must match the name of the data input value uploadFile

Useful Resources