dropzone.js - how to do something after ALL files are uploaded

后端 未结 9 1190
花落未央
花落未央 2020-12-13 05:48

I am using dropzone.js for my drag-drop file upload solution. I am stuck at something where I need to call a function after all the files are uploaded. In this case

9条回答
  •  渐次进展
    2020-12-13 06:41

    I up-voted you as your method is simple. I did make only a couple of slight amends as sometimes the event fires even though there are no bytes to send - On my machine it did it when I clicked the remove button on a file.

    myDropzone.on("totaluploadprogress", function(totalPercentage, totalBytesToBeSent, totalBytesSent ){
                if(totalPercentage >= 100 && totalBytesSent) {
                    // All done! Call func here
                }
            });
    

提交回复
热议问题