I can't have asp.net mvc 1.0 to bind HttpPostedFileBase for me.
this is my EditModel class.
public class PageFileEditModel
{
public HttpPostedFileBase File { get; set; }
public string Category { get; set; }
}
and this is my edit method header.
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(int id, FormCollection formCollection, PageFileEditModel[] pageFiles)
and this is my HTML
<input type="file" name="pageFiles[0].File" />
<input type="text" name="pageFiles[0].Category" />
<input type="file" name="pageFiles[1].File" />
<input type="text" name="pageFiles[1].Category" />
Category is bind correctly, but File is always null.
I've verifed that the files indeed are in Request.Files
.
The HttpPostedFileBaseModelBinder
is added by default so can't figure out what is going wrong..