As you have stated in your comment, you are using Html.Beginform("Contact", "Home", FormMethod.Post
However, can I suggest the following as when posting images to controller methods, it seems to work fine.
@using ("Contact", "Home", FormMethod.Post, new {enctype = "multipart/form-data"})
{
// form things blah blah blag
// When it comes to inputting the image file, I suggest you do the following
// Instead of this @Html.TextBoxFor(m => m.File, new { type = "file", accept="image/*" })
// Have
<input type="file" name="file" id="fileUpload" accept=".png, .jpg, .jpeg"/>
}
You controller method would then be the following to reflect these changes.
public ActionResult Contact(ContactViewModel model, HttpPostedFileBase file)
{
var Image = file.FileName;
}
So what are we doing here?
We are creating a form such as you have done before but we are adding an extra parameter that specifies how the form should be encoded when passing it to the controller.
<input type="file" name="file" id="fileUpload" accept=".png, .jpg, .jpeg"/>
Here we are saying that there will be an input called 'file' that can accept png, jpg or jpeg images.
HttpPostedFileBase file
This is the file that we will be passing. The name
has to be the exact same name as the name
in the input tags