According to the Dropzone.js Documentation the queuecomplete
event is "Called when all files in the queue finish uploading.".
One would also assume this is true given the answers for this question. dropzone.js - how to do something after ALL files are uploaded However the solutions given don't behave as expected for me.
So I have a Dropzone that accepts multiple files and when I queue up more than one file and they have been uploaded - this event seems to be fired multiple times. What is also strange is that the number of time the event is trigger doesn't even correspond to the number of files in the queue.
So my problem is, I need a way of executing some javascript when the queue is finished uploading, I want to do this once (not N
times) I would also be useful to know if any of the files in the queue failed or if they were all successful
HTML
<button id="but">
Process Queue
</button>
<div id="image-uploader" style="--removed--">
</div>
JS
$(function (){
var el = document.getElementById("image-uploader");
var config = {
url: 'http://www.dropzonejs.com/upload',
autoProcessQueue: true,
uploadMultiple: true,
parallelUploads: 15,
maxFiles: 15,
acceptedFiles: "image/*",
init: function () {
this.on("queuecomplete", function () {
alert("I Think I should only see this once.");
});
}
};
var dropZone = new Dropzone(el, config);
$('#but').click(function(){dropZone.processQueue();})
});
I have put together a fiddle demonstrating this.