The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-file-upload/lib/FileUpload.js

22 lines
490 B

/* globals FileUpload:true */
/* exported FileUpload */
var maxFileSize = 0;
FileUpload = {
validateFileUpload(file) {
if (file.size > maxFileSize) {
throw new Meteor.Error('file-too-large', 'File is too large');
}
if (!RocketChat.fileUploadIsValidContentType(file.type)) {
throw new Meteor.Error('invalid-file-type', 'File type is not accepted');
}
return true;
}
};
RocketChat.settings.get('FileUpload_MaxFileSize', function(key, value) {
maxFileSize = value;
});