Hi @Coreysan ,
Here is a working demo which combine Dropzone.js with form submit below.
Model
public class TestViewModel
{
public string Description { get; set; }
public List<IFormFile> File { get; set; }
}
View
@model TestViewModel
<form asp-action="Test" asp-controller="Home" method="post" enctype="multipart/form-data" class="dropzone dz-clickable form-horizontal form-bordered" id="dropzoneForm">
<div>
<input asp-for="Description" />
</div>
<div class="form-group form-actions">
<div class="col-md-9 col-md-offset-4">
<button type="submit" id="submit" class="btn btn-sm btn-primary"><i class="fa fa-floppy-o"></i> Upload</button>
</div>
</div>
</form>
JS:
Controller
[HttpPost]
public async Task<ActionResult> Test(TestViewModel model)
{
//do your sufff...
return View();
}
Note
You can get the js code by downloading the txt file here
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
Rena