octobercms/october · error · ApplicationException

editor::lang.filesystem.too_large

Error message

editor::lang.filesystem.too_large

What it means

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.

Source

Thrown at modules/editor/traits/FileSystemFunctions.php:268

     */
    protected function editorUploadFiles($basePath, $allowedExtensions)
    {
        $uploadedFile = Input::file('file');
        if (!is_object($uploadedFile)) {
            return;
        }

        $fileName = $uploadedFile->getClientOriginalName();

        // Check valid upload
        if (!$uploadedFile->isValid()) {
            throw new ApplicationException(Lang::get('editor::lang.filesystem.file_not_valid'));
        }

        // Check file size
        $maxSize = UploadedFile::getMaxFilesize();
        if ($uploadedFile->getSize() > $maxSize) {
            throw new ApplicationException(Lang::get(
                'editor::lang.filesystem.too_large',
                ['max_size' => File::sizeToString($maxSize)]
            ));
        }

        // Check for valid file extensions
        if (!$this->validateFileSystemFileExtension($fileName, $allowedExtensions)) {
            throw new ApplicationException(Lang::get(
                'editor::lang.filesystem.type_not_allowed',
                ['allowed_types' => implode(', ', $allowedExtensions)]
            ));
        }

        // Validate destination path
        $destinationDir = trim(Request::input('destination'));
        if (!strlen($destinationDir)) {
            throw new ApplicationException(Lang::get('editor::lang.filesystem.select_destination_dir'));
        }

View on GitHub (pinned to b608633a7e)

Solutions

  1. 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
  2. Match the reverse-proxy body limit (Nginx client_max_body_size / Apache LimitRequestBody) to the new value
  3. Enforce the limit client-side (dropzone maxFilesize) so users get immediate feedback instead of a server error
  4. Show File::sizeToString(UploadedFile::getMaxFilesize()) in the UI hint so the cap is visible

Example fix

// before — client allows anything
new Dropzone(el, { url: uploadUrl });

// after — enforce the same cap the server enforces
new Dropzone(el, {
    url: uploadUrl,
    maxFilesize: 32, // MB, mirrors upload_max_filesize
    errortimeout: 8000
});
Defensive patterns

Strategy: validation

Validate before calling

$max = \Symfony\Component\HttpFoundation\File\UploadedFile::getMaxFilesize();
if ($file->getSize() > $max) {
    // Reject client-side with a clear message instead of letting the endpoint throw
    return Response::json(['error' => 'Max '.\October\Rain\Filesystem\Filesystem::sizeToString($max)], 422);
}

Prevention

When it happens

Trigger: 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().

Common situations: 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.

Related errors


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/cb9bb9faf5f6d45b. Report an issue: GitHub.