Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
acceptedFiles: 'image/*',
addRemoveLinks: false,
autoProcessQueue: true,
// matches Spring Boot setting
maxFilesize: 1,
url: this.url,
dictDefaultMessage: DEFAULT_MESSAGE,
dictFallbackMessage: i18n['dropzone.dictFallbackMessage'],
dictFallbackText: i18n['dropzone.dictFallbackText'],
dictFileTooBig: i18n['dropzone.dictFileTooBig'],
dictInvalidFileType: i18n['dropzone.dictInvalidFileType'],
dictResponseError: i18n['dropzone.dictResponseError'],
dictCancelUpload: i18n['dropzone.dictCancelUpload'],
dictCancelUploadConfirmation: i18n['dropzone.dictCancelUploadConfirmation'],
dictRemoveFile: i18n['dropzone.dictRemoveFile'],
dictRemoveFileConfirmation: i18n['dropzone.dictRemoveFileConfirmation'],
// check file dimensions before upload
// see https://github.com/enyo/dropzone/wiki/FAQ#reject-images-based-on-image-dimensions
accept: function(file, done) {
file.acceptDimensions = done;
file.rejectDimensions = function() {
done(i18n['customizations.fileDimensionsInvalid']);
};
},
init: function() {
// Register for the thumbnail callback
// When the thumbnail is created the image dimensions are set
this.on('thumbnail', function(file) {
if(file.width === width && file.height === height) {
file.acceptDimensions();
} else {
file.rejectDimensions()