octobercms/october · error · ValidationException
Invalid file name: :name. File names can contain only alphan
Error message
Invalid file name: :name. File names can contain only alphanumeric symbols, underscores, dashes and dots. Some examples of correct file names: page.htm, page, subdirectory/page
What it means
Error "Invalid file name: :name. File names can contain only alphanumeric symbols, underscores, dashes and dots. Some examples of correct file names: page.htm, page, subdirectory/page" thrown in octobercms/october.
Source
Thrown at modules/cms/classes/CmsObject.php:328
* @param Exception $ex
*/
protected static function throwHalcyonException(Exception $ex)
{
if ($ex instanceof \October\Rain\Halcyon\Exception\MissingFileNameException) {
throw new ValidationException([
'fileName' => Lang::get('cms::lang.cms_object.file_name_required')
]);
}
elseif ($ex instanceof \October\Rain\Halcyon\Exception\InvalidExtensionException) {
throw new ValidationException(['fileName' =>
Lang::get('cms::lang.cms_object.invalid_file_extension', [
'allowed' => implode(', ', $ex->getAllowedExtensions()),
'invalid' => $ex->getInvalidExtension()
])
]);
}
elseif ($ex instanceof \October\Rain\Halcyon\Exception\InvalidFileNameException) {
throw new ValidationException([
'fileName' => Lang::get('cms::lang.cms_object.invalid_file', ['name'=>$ex->getInvalidFileName()])
]);
}
elseif ($ex instanceof \October\Rain\Halcyon\Exception\InvalidDirectoryNameException) {
throw new ValidationException([
'fileName' => Lang::get('cms::lang.cms_object.invalid_file', ['name'=>$ex->getInvalidDirectoryName()])
]);
}
elseif ($ex instanceof \October\Rain\Halcyon\Exception\FileExistsException) {
throw new ValidationException(['fileName' =>
Lang::get('cms::lang.cms_object.file_already_exists', ['name' => $ex->getInvalidPath()])
]);
}
elseif ($ex instanceof \October\Rain\Halcyon\Exception\CreateDirectoryException) {
throw new ValidationException(['fileName' =>
Lang::get('cms::lang.cms_object.error_creating_directory', ['name' => $ex->getInvalidPath()])
]);
}View on GitHub (pinned to b608633a7e)
When it happens
Trigger: Thrown at modules/cms/classes/CmsObject.php:328 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/7db40aea5447d028.
Report an issue: GitHub.