octobercms/october · error · ApplicationException
Maximum allowed size for uploaded files:
Error message
Maximum allowed size for uploaded files:
What it means
Thrown by FileUpload::prepareVars when the widget's configured maxFilesize exceeds the PHP upload_max_filesize/post_max_size limit. It is a configuration-sanity guard: the widget cannot honor a limit larger than the server allows, and the message reports the effective PHP ceiling.
Solutions
- Lower the widget's maxFilesize config to at or below the PHP upload_max_filesize
- Raise upload_max_filesize (and post_max_size) in php.ini and restart PHP to allow larger files
- Compute and display the effective limit from getUploadMaxFilesize() in custom UIs
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at modules/backend/formwidgets/FileUpload.php:163 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/315b062952e7439b.
Report an issue: GitHub.
Appendix: source
Thrown at modules/backend/formwidgets/FileUpload.php:163
return $this->makePartial('fileupload');
}
/**
* prepareVars for the view data
*/
protected function prepareVars()
{
if ($this->formField->disabled) {
$this->previewMode = true;
}
if ($this->previewMode) {
$this->useCaption = false;
}
$maxPhpSetting = $this->getUploadMaxFilesize();
if ($maxPhpSetting && $this->maxFilesize > $maxPhpSetting) {
throw new ApplicationException('Maximum allowed size for uploaded files: ' . $maxPhpSetting);
}
$this->vars['name'] = $this->getFieldName();
$this->vars['fileList'] = $fileList = $this->getFileList();
$this->vars['singleFile'] = $fileList->first();
$this->vars['size'] = $this->formField->size;
$this->vars['displayMode'] = $this->getDisplayMode();
$this->vars['emptyIcon'] = $this->getConfig('emptyIcon', 'icon-upload');
$this->vars['imageHeight'] = $this->imageHeight;
$this->vars['imageWidth'] = $this->imageWidth;
$this->vars['acceptedFileTypes'] = $this->getAcceptedFileTypes(true);
$this->vars['maxFilesize'] = $this->maxFilesize;
$this->vars['maxFiles'] = $this->maxFiles;
$this->vars['cssDimensions'] = $this->getCssDimensions();
$this->vars['useCaption'] = $this->useCaption;
$this->vars['externalToolbarBus'] = $this->externalToolbarBus;
}
View on GitHub (pinned to b608633a7e)