ASP.NET MVC posted file model binding when parameter is Model
问题 Is there any way to get posted files ( <input type="file" /> ) to take part in model binding in ASP.NET MVC without manually looking at the request context in a custom model binder, and without creating a separate action method which only takes a posted file as input? I would have thought that this would work: class MyModel { public HttpPostedFileBase MyFile { get; set; } public int? OtherProperty { get; set; } } <form enctype="multipart/form-data"> <input type="file" name="MyFile" /> <input