Reputation: 1024
How can overwrite the previous upload when I drop another file again.
Example: Drag file A into the dropzone. It will uploaded file A. Then I drag file B into the same dropzone, it will removed file A (No need to remove from server side) and upload file B.
Upvotes: 0
Views: 2137
Reputation: 77
you can assign a listener to the addedfile
event, and handle this problem.
this.on("addedfile", function(file) {
// you code, maybe like below
var files = myDropzone.getFilesWithStatus('success');
if(files.length > 0 ){
for(int i = 0; i < files.length ; i++){
myDropzone.removeFile(files[i]);
}
}
});
Upvotes: 2