Загрузка файла возвращает null

Я загружаю файл в свое приложение ASP.NET MVC с помощью Uploadify.

Контроллер:

public ActionResult Upload(HttpPostedFileBase file)
        {           
            List<string> validIDs, invalidIDs;
            if (file.ContentLength > 0)
            { //do something
            }
        }

Загрузить код (в файл.ascx):

$(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,   //1 MB
        'buttonText': 'Upload Files'
}
    });
});

«Файл» в действии контроллера всегда возвращает NULL. Что мне не хватает?

5
задан GoldenUser 6 April 2012 в 20:21
поделиться