I have been looking around and playing for a little while now with the dropzone.js library and cannot get the maxfilesexceeded event to fire. I have looked at the How to limit the number of dropzone.js files uploaded? post for info and have updated to the latest version of the library but the event still wont fire.
I am initialising the listener in the init() function as suggested in the post above. I am able to catch the maxfilesreached
event but not the maxfilesexceeded
event
$scope.fileUploadConfig = {
options: {
url: uploadFileURL,
maxThumbnailFilesize: 200,
maxFiles: 5,
uploadMultiple: false,
acceptedFiles: "application/vnd.oasis.opendocument.text,application/rtf,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,.xls,.xlsx,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,.ppt,.pptx,image/*,.mp3,.m4a,.ogg,.wav,.wma",
addRemoveLinks: true,
paramName: "file",
dictRemoveFile: "Remove",
clickable: true,
previewTemplate: $("#dropzone-preview-template").html(),
init: function() {
var instance = this,
selectedPageId = 0;
instance.on("success", function(event, data) {
/* ... */
});
instance.on("addedfile", function() {
/* ... */
});
instance.on("removedfile", function(file) {
/* ... */
});
instance.on("maxfilesreached", function(file) {
alert("MAX_FILES_REACHED");
});
instance.on("maxfilesexceeded", function(file) {
alert("MAX_FILES_EXCEEDED");
});
}
}
};
All the code is working as expected except for the maxfilesexceeded event.