Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
190
rated 0 times [  196] [ 6]  / answers: 1 / hits: 36066  / 11 Years ago, mon, august 5, 2013, 12:00:00

I use Dropzone.js and I want it to upload the dropped not automatically but when the user clicks a button. So I set the autoProcessQueue option to false. When the button is clicked the processQueue() method is called. I would suppose that now the full queue is processed. But thats not the case. Only the number of files which is specified in the parallelUploads option will be uploaded. The standard value of parallelUploads seems to be 2. Which every click 2 files are processed and uploaded.



Do I have to set parallelUploads to an very high number, for now to solve this?



Here's my full JS code:



var myDropzone = new Dropzone(div#myId, {
url: http://www.torrentplease.com/dropzone.php,
addRemoveLinks: true,
thumbnailWidth: 80,
thumbnailHeight: 80,
dictCancelUpload: Cancel,
autoProcessQueue: false
});

myDropzone.on(drop, function(event) {
$('.edit_tooltip .option_bar').animate({
opacity: 1,
top: -5
});
});


$('.edit_tooltip .option_bar .button').click(function() {
myDropzone.processQueue();
});

More From » jquery

 Answers
42

There's a simple way to solve this which can be found here:



https://github.com/enyo/dropzone/issues/253#issuecomment-22184190



If you want autoProcessQueue to be true after the first upload, then just listen to the processing event, and set this.options.autoProcessQueue = true; inside.



So just add



this.on(processing, function() {
this.options.autoProcessQueue = true;
});

[#76521] Saturday, August 3, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ramiro

Total Points: 431
Total Questions: 96
Total Answers: 105

Location: Northern Ireland
Member since Mon, Nov 14, 2022
2 Years ago
;