Clear dropzone.js thumbnail image after uploading an image
removeAllFiles()
and removeFile()
will trigger the server-side removal too, if you hooked Dropzone to remove files as well.
The solution to clear it only client-side, remove the file preview, and if you had a blank state message, remove the dz-started
class to prevent the Dropzone CSS from hiding it:
$('.dropzone')[0].dropzone.files.forEach(function(file) {
file.previewElement.remove();
});
$('.dropzone').removeClass('dz-started');
You can try this:
myDropzone.on("complete", function(file) {
myDropzone.removeFile(file);
});
More information here: http://www.dropzonejs.com/#dropzone-methods