I am trying to send multiple files in one request using DropZone js.
Here's my code :
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone('#upload-Invoices', {
paramName: "files",
maxFilesize: 3.0,
maxFiles: 4,
parallelUploads: 10000,
uploadMultiple: true,
autoProcessQueue: false
});
$('#btnUpload').on('click', function () {
myDropzone.processQueue();
});
Controller :
public void FileUpload( IEnumerable<HttpPostedFileBase> file )
{
// Do Something
}
View:
<form action="/Index/FileUpload"
class="dropzone"
id="upload-Invoices" data-ajax-method="POST" data-ajax="true">
<input type="submit" value="Upload File to Server" id="btnUpload">
</form>
The files are being received although in diferrent requests, I want to send all files in one request, the Dropzone page has an option for it although it does not work. Thanks in Advance
I'm using Dropzone. js for my website. I'm in the need of uploading bigger files than the default maxFilesize of 500MB.
you can use uploadMultiple property default value false change it to true
$(".dropzone").dropzone({
// autoQueue:false,
parallelUploads:10,
uploadMultiple:true,
https://www.dropzonejs.com/#config-uploadMultiple
The Issue was that I was using an input type="submit"
which would do another post by itself, changing it to type button
worked.
Had the same problem, just add autoDiscover: false, to your dropzone options and it should work!
My options are like this:
Dropzone.options.UploadZone = {
addRemoveLinks: true,
autoDiscover: false,
uploadMultiple: true,
parallelUploads: 10,
maxFiles: 10,
acceptedFiles: ".jpeg,.jpg,.png",
autoProcessQueue: false,
...
With autoProcessQueue: false and uploadMultiple: true: for each 2 files i was getting a request.
Then I added parallelUploads: 10 and maxFiles: 10 and i don't know why but my first 2 files started uploading as soon as i putted them on the dropzone, even with autoProcessQueue: false.
Then I just add autoDiscover: false and everything worked fine from there!
good look!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With