admin管理员组文章数量:1435762
Using Dropzone.js I need to implement a way when a user drop a file into Dropzone all current uploads (if any) are canceled so only the current one gets uploaded.
I need a way to select and delete those.
I can do MyDropzone.processQueue
to get the uploading queue files. I can also do MyDropzone.removeAllFiles()
but this removes all items (uploading or uploaded).
I don't understand how can I apply the removeAllFiles()
method only to the files that are in MyDropzone.processQueue
.
Any idea how to acplish this?
Using Dropzone.js I need to implement a way when a user drop a file into Dropzone all current uploads (if any) are canceled so only the current one gets uploaded.
I need a way to select and delete those.
I can do MyDropzone.processQueue
to get the uploading queue files. I can also do MyDropzone.removeAllFiles()
but this removes all items (uploading or uploaded).
I don't understand how can I apply the removeAllFiles()
method only to the files that are in MyDropzone.processQueue
.
Any idea how to acplish this?
Share Improve this question edited Apr 15, 2013 at 7:16 Charles 51.5k13 gold badges106 silver badges144 bronze badges asked Apr 14, 2013 at 22:15 MartinMartin 11.3k23 gold badges86 silver badges143 bronze badges2 Answers
Reset to default 1The latest version of Dropzone provides methods for this, as well as a addRemoveLinks
option that inserts links to cancel/remove uploads.
Try:
Dropzone.autoDiscover = false;
$("#mydropzone").dropzone({
init: function() {
var $this = this;
$("button#clear-dropzone").click(function() {
$this.removeAllFiles(true);
});
}
});
本文标签: javascriptDropzonejs how to cancel uploads when dropping new fileStack Overflow
版权声明:本文标题:javascript - Dropzone.js: how to cancel uploads when dropping new file - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745646661a2668176.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论