投递结束后,上传前的Dropzone.js事件 [英] Dropzone.js event after drop end and before uploading
问题描述
我正在寻找一个 dropzone.js
事件,该事件在放置结束后和上载之前引发。
I'm looking for a dropzone.js
event that raises after the drop end and just before the uploading.
我需要的是一次访问所有有关已删除文件的信息,而不是逐个文件,因此 addedfile
事件不是一种选择。
What I need is to have access to all the information about the dropped files at once, not file by file thus addedfile
event is not an option.
我认为 dragend
事件是适当的,但是当我将文件放到dropzone中时不会触发该事件。
I thought that the dragend
event was the appropriate, but it's not triggered when I drop the files in my dropzone.
我正在使用的代码段如下所示:
The code snippet that I'm using looks like as follows:
Dropzone.options.myDropzone = {
// Prevents Dropzone from uploading dropped files immediately
autoProcessQueue : false,
dictDefaultMessage: "Drop files or click here to upload a new DICOM series ...",
init : function() {
myDropzone = this;
//Restore initial message when queue has been completed
this.on("dragend", function(file) {
console.log("ondragend");
});
}
};
我错过了什么吗?为此,在 dropzone.js
中还有其他事件吗?
Am I missing something? Is there any other event in dropzone.js
for this purpose?
推荐答案
有一个事件称为 已添加文件
,将同时在拖放和和手动选择文件。
There is an event called addedfiles
, which will fire on both "drag-and-drop" and manual file selection.
this.on("addedfiles", function(files) {
console.log(files.length + ' files added');
});
这篇关于投递结束后,上传前的Dropzone.js事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!