Topic: How to upload files from Queue widget with HttpPost
I need some help with uploading files on my server.
@using (Html.BeginForm("Upload", "Home", FormMethod.Post, new { enctype="multipart/form-data" }))
{
<div id="uploader" style="width: 450px; height: 330px;">Your browser doesn't support upload.</div>
<input type="submit" class="btn btn-large btn-success" value="Transfer" />
}
With a hit on the submit button he needs to upload the file inside the uploader to my server but my problem is that it is always empty.
My Controller:
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Upload(HttpPostedFileBase file)
{
System.Console.WriteLine(file.FileName);
return View("Index");
}