在dropzone中,当我将addedfile事件添加到选项中以防止添加重复文件时,重复问题可以正常工作但不会将任何缩略图添加到列表中。
Dropzone.options.myAwesomeDropzone = {
paramName: "upload_photo",
maxFilesize: 5, // MB
maxFiles:15,
addRemoveLinks:true,
thumbnailWidth: 170,
thumbnailHeight: 110,
acceptedFiles: ".png,.jpg",
addedfile: function(file){
if (this.files.length) {
var _i, _len;
for (_i = 0, _len = this.files.length; _i < _len - 1; _i++) // -1 to exclude current file
{
if(this.files[_i].name === file.name && this.files[_i].size === file.size)
{
this.removeFile(file);
}else{
Here might need to have some codes
}
}
}
}
})
现在如何同时添加重复预防和新缩略图?