Make sure you have the enctype on the form set to multipart/form-data
What data type is model.File ?
Check this out :
Implementing HTTP File Upload with ASP.NET MVC[
^]
I'm editing this so I can show code. You will need to post your code if you want specific help, but I just whipped up a quick solution that worked for me, here's my code:
The Model:
public class MyModel
{
public HttpPostedFileBase MyFile { get; set; }
}
The View:
@model FileUploadTest.Models.MyModel
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>title</title>
</head>
<body>
<div>
@using (Html.BeginForm("PostFile", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div>
Upload file: @Html.TextBoxFor(m => m.MyFile, new { Type="file"})
<p>
<input type="submit" value="go"/>
</p>
</div>
}
</div>
</body>
</html>
The controller:
public ActionResult PostFile(MyModel myModel)
{
return this.View();
}
NOTE: I didn't do anything in the controlller, only set a breakpoint and made sure the value was being posted back and it was. I included the controller action here so you could make sure you were passing your model into it with the post back.
For further help you will really need to post your own code so we can see what you're doing.