As i searched on the google, there is no way to send one request for multiple "dropzone" with the same URL, so i solved this problem manually by the following steps:
1) Dropzone actually change the images to Base64 string for thumbnail preview and then it add that string to the source of "img" tag. So you need to read that image "src" and "alt", and also add them to the input type hidden dynamically as the following:
$('#btnUpload').on('click', function () {
$.each($("img[data-dz-thumbnail]"), function( index, value ) {
$('<input>').attr({
type: 'hidden',
name: 'myHiddenFiles[' + index + '].Key',
value: $(value).attr("alt")
}).appendTo('#newsForm');
$('<input>').attr({
type: 'hidden',
name: 'myHiddenFiles[' + index + '].Value',
value: $(value).attr("src")
}).appendTo('#upload-Invoices');
});
$("#upload-Invoices").submit();
});
Repeat this codes for each dropzone you need to post their data.
2) On your action method, you need to add a parameter with type "Dictionary" in order to get file name and file content with Base64 string format.
Then you can parse the Base64 string as image, store it as a file and save your form data to the database.
You can see the related snippet code as following:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(ModelClass model, IDictionary<string, string> myHiddenFiles)
{
if (ModelState.IsValid)
{
foreach (var file in myHiddenFiles)
{
var base64 = file.Value.Substring(file.Value.IndexOf(',') + 1).Trim('\0');
var bytes = Convert.FromBase64String(base64);
var saveFile = Server.MapPath("~/Images/" + file.Key);
System.IO.File.WriteAllBytes(saveFile, bytes);
// Save your model to database....
}
}
return View();
}