asp.net mvc post file to controller code example
Example 1: mvc input type file
@using (Html.BeginForm("Action", "Controller", FormMethod.Post, new
{ enctype = "multipart/form-data" }))
{
@Html.TextBoxFor(m => m.File, new { type = "file" })
@Html.ValidationMessageFor(m => m.File)
}
Example 2: file upload in asp.net c# mvc example
public HttpPostedFile ImageFile { get; set; }