I am trying to implement Dropzone.js in ASP.Net MVC. I tried everything but somehow I cannot receive the dropped file in the controller. The variable is just NULL.
My View looks like this:
<h2>DropZoneUp</h2>
<form action='@Url.Action("DropZoneUpload")'class="dropzone"id="my-awesome-dropzone">
</form>
<script src="~/Scripts/dropzone.js"></script>
My Controller looks like this:
[HttpPost]
public ActionResult DropZoneUpload(IEnumerable<HttpPostedFileBase> files)
{
foreach (var file in files)
{
string filePath = Guid.NewGuid() + Path.GetExtension(file.FileName);
file.SaveAs(Path.Combine(Server.MapPath("~/ExcelNDropUpload"), filePath));
}
return Json("fileupload successfully");
}
The Controller actually gets called from the View. But the "IEnumerable files" are Null. Does anybody have an idea what I am doing wrong?
Thanks in advance!
best regards BeardyBear