I\'m implementing dropzone.js and everything is perfect until I try to upload multiple files with the same name, let\'s say uploading photos from an iOS device where all hav
This is a very simple way to do it based off hien's answer. This example also users the jQuery plugin.
When a file is added, have the server echo back name of the file on the server. Capture this with the dropzone success event, appending the server file name as a new property on the file object. Then you can access the property on the dropzone removedfile event, and send it back to the server as the name of the file to be deleted.
this.on("success", function (file, serverFileName) {
file.serverFileName = serverFileName;
});
this.on("removedfile", function (file) {
$.post("process.php?deleteFile=" + encodeURIComponent(file.serverFileName));
});