Reputation: 2777
I'm working on some modifications to the dropzonejs
image uploader. I want to allow a maximum of 12 image uploads. I see the config for maxFiles
, but after setting this to 12 it still allows files to be added and generates thumbnail previews. Is there are way to modify, so once the limit of 12 is reached it will no longer generate a thumbnail or add the files to the upload list?
Upvotes: 0
Views: 47
Reputation: 3259
Use the dropzone maxfilesexceeded
event, that triggers for every file rejected for exced the limit, to remove this files:
Dropzone.options.myDropzone = {
maxFiles: 12,
init: function() {
this.on('maxfilesexceeded', function(file){
this.removeFile(file);
});
}
};
Upvotes: 1