{"record":{"id":"cb9bb9faf5f6d45b","repo":"octobercms/october","slug":"editor-lang-filesystem-too-large","errorCode":null,"errorMessage":"editor::lang.filesystem.too_large","messagePattern":"editor::lang\\.filesystem\\.too_large","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/editor/traits/FileSystemFunctions.php","lineNumber":268,"sourceCode":"     */\n    protected function editorUploadFiles($basePath, $allowedExtensions)\n    {\n        $uploadedFile = Input::file('file');\n        if (!is_object($uploadedFile)) {\n            return;\n        }\n\n        $fileName = $uploadedFile->getClientOriginalName();\n\n        // Check valid upload\n        if (!$uploadedFile->isValid()) {\n            throw new ApplicationException(Lang::get('editor::lang.filesystem.file_not_valid'));\n        }\n\n        // Check file size\n        $maxSize = UploadedFile::getMaxFilesize();\n        if ($uploadedFile->getSize() > $maxSize) {\n            throw new ApplicationException(Lang::get(\n                'editor::lang.filesystem.too_large',\n                ['max_size' => File::sizeToString($maxSize)]\n            ));\n        }\n\n        // Check for valid file extensions\n        if (!$this->validateFileSystemFileExtension($fileName, $allowedExtensions)) {\n            throw new ApplicationException(Lang::get(\n                'editor::lang.filesystem.type_not_allowed',\n                ['allowed_types' => implode(', ', $allowedExtensions)]\n            ));\n        }\n\n        // Validate destination path\n        $destinationDir = trim(Request::input('destination'));\n        if (!strlen($destinationDir)) {\n            throw new ApplicationException(Lang::get('editor::lang.filesystem.select_destination_dir'));\n        }","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/editor/traits/FileSystemFunctions.php#L250-L286","documentation":"Thrown by editorUploadFiles when the uploaded file's on-disk size exceeds UploadedFile::getMaxFilesize(), which is the smaller of the php.ini upload_max_filesize and post_max_size values converted to bytes. Note that most truly oversized browser uploads die earlier at isValid() (UPLOAD_ERR_INI_SIZE), so reaching this branch typically means a programmatic client (API, Guzzle, test harness) submitted a file that passed PHP's initial check, or post_max_size was configured larger than upload_max_filesize.","triggerScenarios":"A scripted upload (cURL/Guzzle) posting a file bigger than the limit without PHP aborting; php.ini with post_max_size > upload_max_filesize; a chunked uploader reassembling a file that then exceeds getMaxFilesize().","commonSituations":"Admins raising one ini directive but not its pair; server tuning after sysadmin changes without php-fpm reload; users exporting large media (4K video, huge ZIPs) exceeding the configured ceiling.","solutions":["Raise both upload_max_filesize and post_max_size in php.ini (post_max_size should be the larger of the two to account for form fields) and reload php-fpm","Match the reverse-proxy body limit (Nginx client_max_body_size / Apache LimitRequestBody) to the new value","Enforce the limit client-side (dropzone maxFilesize) so users get immediate feedback instead of a server error","Show File::sizeToString(UploadedFile::getMaxFilesize()) in the UI hint so the cap is visible"],"exampleFix":"// before — client allows anything\nnew Dropzone(el, { url: uploadUrl });\n\n// after — enforce the same cap the server enforces\nnew Dropzone(el, {\n    url: uploadUrl,\n    maxFilesize: 32, // MB, mirrors upload_max_filesize\n    errortimeout: 8000\n});","handlingStrategy":"validation","validationCode":"$max = \\Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getMaxFilesize();\nif ($file->getSize() > $max) {\n    // Reject client-side with a clear message instead of letting the endpoint throw\n    return Response::json(['error' => 'Max '.\\October\\Rain\\Filesystem\\Filesystem::sizeToString($max)], 422);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce maxFilesize in the client uploader equal to the PHP limit","Treat upload_max_filesize and post_max_size as a pair when changing php.ini; reload php-fpm after edits","Surface the server limit in the UI so users know the cap before choosing a file"],"tags":["upload","php-ini","size-limit","editor"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}