removeFile
accept
处理程序。
所以,我的
处理程序如下所示:
accept: function(file) {
if (/* condition not met */) {
alert("You haven't met the condition. No upload for you!");
deleteOnServer = false;
this.removeFile(file);
deleteOnServer = true;
return false;
}
/* otherwise, do normal "accept" processing. */
在我的Dropzone中注册“removedFile”事件处理程序
init
init: function() {
this.on("removedFile", function(file) {
if (!deleteOnServer) {
return false;
}
/* otherwise, send $.ajax(DELETE) request to server */
:
}