Пожалуйста, используйте ниже
HTML:
<form action="/uploadImages" id="buldUploadForm" enctype="multipart/form-data" method="post">
<div class="dropzone dz-clickable" id="uploadDropzone">
<div class="dz-default dz-message" data-dz-message="">
<span>Drop files here to upload</span>
</div>
</div>
<br />
<input type="submit" class="btn btn-primary" id="submitAllProcess" value="Upload Images" name="submit" />
</form>
JAVASCRIPT:
Dropzone.autoDiscover = false;
function paramNameForSend() {
return "userParamName";
}
$(document).ready(function() {
var myDropzone = new Dropzone("#uploadDropzone", {
url: '/uploadImages',
maxFilesize: 5, // MB
maxFiles: 10,
autoProcessQueue: false,
uploadMultiple: true,
paramName: paramNameForSend,
method: 'post',
parallelUploads: 10,
init: function() {
var myDropzone = this;
$("#buldUploadForm").submit(function (e) {
e.preventDefault();
e.stopPropagation();
myDropzone.processQueue();
});
}
});
});
MULTER:
var storage = multer.diskStorage({
destination: function (req, file, callback) {
callback(null, './uploads');
}
});
var uploadMultiple = multer({ storage : storage}).array('userParamName', 10);
Любое решение это было бы хорошо оценены. – NikxDa