You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Matias Meno edited this page Jul 27, 2020
·
4 revisions
This tutorial shows how to let the user build a queue and then upload all files with a single button click.
First off the HTML:
<buttonid="submit-all">Submit all files</button><formaction="/target" class="dropzone" id="my-dropzone"></form>
and the JS:
Dropzone.options.myDropzone={// Prevents Dropzone from uploading dropped files immediatelyautoProcessQueue: false,init: function(){varsubmitButton=document.querySelector("#submit-all")myDropzone=this;// closuresubmitButton.addEventListener("click",function(){myDropzone.processQueue();// Tell Dropzone to process all queued files.});// You might want to show the submit button only when // files are dropped here:this.on("addedfile",function(){// Show submit button here and/or inform user to click it.});}};