{"record":{"id":"70cd0dd675669cf6","repo":"RocketChat/Rocket.Chat","slug":"error-file-too-large","errorCode":"error-file-too-large","errorMessage":"File size exceeds upload limit of {{size}}.","messagePattern":"File size exceeds upload limit of (.+?)\\}\\.","errorType":"error_code","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts","lineNumber":182,"sourceCode":"\t\t}\n\t\tconst language = user?.language || 'en';\n\t\tif (!fileUploadAllowed) {\n\t\t\tconst reason = i18n.t('FileUpload_Disabled', { lng: language });\n\t\t\tthrow new Meteor.Error('error-file-upload-disabled', reason);\n\t\t}\n\n\t\tif (room && !directMessageAllowed && room.t === 'd') {\n\t\t\tconst reason = i18n.t('File_not_allowed_direct_messages', { lng: language });\n\t\t\tthrow new Meteor.Error('error-direct-message-file-upload-not-allowed', reason);\n\t\t}\n\n\t\t// -1 maxFileSize means there is no limit\n\t\tif (maxFileSize > -1 && (file.size || 0) > maxFileSize) {\n\t\t\tconst reason = i18n.t('File_exceeds_allowed_size_of_bytes', {\n\t\t\t\tsize: filesize(maxFileSize),\n\t\t\t\tlng: language,\n\t\t\t});\n\t\t\tthrow new Meteor.Error('error-file-too-large', reason);\n\t\t}\n\n\t\tif (!settings.get('E2E_Enable_Encrypt_Files') && isE2EEUpload(file)) {\n\t\t\tconst reason = i18n.t('Encrypted_file_not_allowed', { lng: language });\n\t\t\tthrow new Meteor.Error('error-invalid-file-type', reason);\n\t\t}\n\n\t\t// E2EE files should be of type application/octet-stream. no information about them should be disclosed on upload if they are encrypted\n\t\tif (isE2EEUpload(file)) {\n\t\t\tfile.type = 'application/octet-stream';\n\t\t}\n\n\t\t// E2EE files are of type application/octet-stream, which is whitelisted for E2EE files\n\t\tif (!fileUploadIsValidContentType(file?.type, isE2EEUpload(file) ? 'application/octet-stream' : undefined)) {\n\t\t\tconst reason = i18n.t('File_type_is_not_accepted', { lng: language });\n\t\t\tthrow new Meteor.Error('error-invalid-file-type', reason);\n\t\t}\n","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts#L164-L200","documentation":"Error \"File size exceeds upload limit of {{size}}.\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts:182 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the file size below the configured FileUpload_MaxFileSize limit and retry.","Ask an administrator to raise the maximum upload file size setting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}