I think you are not dropzone up dropzone .
init: function() { addRemoveLinks: true,
Invalid code.
Use it as
Dropzone.options.myAwesomeDropzone = { addRemoveLinks: true, init: function() { } ... };
otherwise you can also use like this.addRemoveLinks = true
If you want to handle the file deletion event, you can use this as
removedfile: function(file) { x = confirm('Do you want to delete?'); if(!x) return false; }
Process file deletion on the server side.
with the successful dropzone method, click the file name into the array, for example: file_up_names=[];
success:function(file){ file_up_names.push(file.name);
now when you delete, get the name and submit it to the php page to delete the file.
removedfile: function(file) { x = confirm('Do you want to delete?'); if(!x) return false; for(var i=0;i<file_up_names.length;++i){ if(file_up_names[i]==file.name) { $.post('delete_file.php',file_name:file_up_names[i]},function(data,status){ alert('file deleted'); }); }
Also note that if you changed the file name on the server side, you need to return this file name for deletion.
source share