I have a problem with my dropzone,
$(".js-example-basic-multiple").select2(); Dropzone.options.dropZone = { //options here maxFilesize: 2, addRemoveLinks: true, removedfile: function(file) { var name = file.name; $.ajax({ type: 'POST', url: host+'upload/unfile', data: "id="+name, dataType: 'html' }); var _ref; return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0; //console.log(); }, init: function() { this.on("maxfilesexceeded", function(file){ alert("No more files please!"); }); } } My problem is, when a file fails to upload, it still shows the preview images, so i need that file to be removed automatically when these file fails to upload, how can I do that??