RocketChat/Rocket.Chat · error · Meteor.Error
error-file-too-large
error-file-too-large
Error message
File size exceeds upload limit of {{size}}. What it means
Error "File size exceeds upload limit of {{size}}." thrown in RocketChat/Rocket.Chat.
Source
Thrown at apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts:182
}
const language = user?.language || 'en';
if (!fileUploadAllowed) {
const reason = i18n.t('FileUpload_Disabled', { lng: language });
throw new Meteor.Error('error-file-upload-disabled', reason);
}
if (room && !directMessageAllowed && room.t === 'd') {
const reason = i18n.t('File_not_allowed_direct_messages', { lng: language });
throw new Meteor.Error('error-direct-message-file-upload-not-allowed', reason);
}
// -1 maxFileSize means there is no limit
if (maxFileSize > -1 && (file.size || 0) > maxFileSize) {
const reason = i18n.t('File_exceeds_allowed_size_of_bytes', {
size: filesize(maxFileSize),
lng: language,
});
throw new Meteor.Error('error-file-too-large', reason);
}
if (!settings.get('E2E_Enable_Encrypt_Files') && isE2EEUpload(file)) {
const reason = i18n.t('Encrypted_file_not_allowed', { lng: language });
throw new Meteor.Error('error-invalid-file-type', reason);
}
// E2EE files should be of type application/octet-stream. no information about them should be disclosed on upload if they are encrypted
if (isE2EEUpload(file)) {
file.type = 'application/octet-stream';
}
// E2EE files are of type application/octet-stream, which is whitelisted for E2EE files
if (!fileUploadIsValidContentType(file?.type, isE2EEUpload(file) ? 'application/octet-stream' : undefined)) {
const reason = i18n.t('File_type_is_not_accepted', { lng: language });
throw new Meteor.Error('error-invalid-file-type', reason);
}
View on GitHub (pinned to b2c16d5842)
Solutions
- Reduce the file size below the configured FileUpload_MaxFileSize limit and retry.
- Ask an administrator to raise the maximum upload file size setting.
When it happens
Trigger: Thrown at apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts:182 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/70cd0dd675669cf6.
Report an issue: GitHub.