I upload a file to my ASP.NET MVC application using the Download program.
Controller:
public ActionResult Upload(HttpPostedFileBase file)
{
List<string> validIDs, invalidIDs;
if (file.ContentLength > 0)
{
}
}
Download code (to .ascx file):
$(document).ready(function () {
$("#file_upload").uploadify({
'uploader': '/Scripts/uploadify/uploadify.swf',
'script': '/XYZ/Upload',
'cancelImg': '/Scripts/uploadify/cancel.png',
'fileExt': '*.jpg;*.gif;*.png;*.bmp;*.htm;*.html;*.zip',
'fileDesc': '*.jpg;*.gif;*.png;*.bmp;*.htm;*.html;*.zip',
'auto': true,
'multi': false,
'sizeLimit': 1048576,
'buttonText': 'Upload Files'
}
});
});
A “file” in a controller action always returns NULL. What am I missing?
source
share