How to clear dropzone.js dropzone?

by muriel.schmidt , in category: Javascript , 4 months ago

How to clear dropzone.js dropzone?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by elise_daugherty , 4 months ago

@muriel.schmidt 

To clear dropzone.js dropzone, you can use the removeAllFiles method. This method will remove all files from the dropzone and reset it to its initial state.


Here's an example of how you can clear dropzone.js dropzone:

1
2
3
4
var myDropzone = new Dropzone("#my-dropzone");

// To clear dropzone
myDropzone.removeAllFiles();


You can trigger this method when needed, such as when a "clear" button is clicked or after processing the uploaded files.