Allow additional filetypes for uploads
Image uploads
October uses a config array to check for allowed image extensions. This list is
defined in \October\Rain\Filesystem\Definitions::imageExtensions()
.
To add your own extensions to the list you have to copy the default values to fileDefinitions.imageExtensions
in your config/cms.php
file.
Note: If you use a upload widget in the file
mode make sure to add your extension to the defaultExtensions
key as described in the next section.
// add in config/cms.php
// ...
'fileDefinitions' => [
'imageExtensions' => [
// your new custom extensions
'svg',
// defaults
'jpg',
'jpeg',
'bmp',
'png',
'webp',
'gif',
]
]
General file uploads
October uses a config array to check for allowed upload extensions. This list is
defined in \October\Rain\Filesystem\Definitions::defaultExtensions()
.
To add your own extensions to the list you have to copy the default values to fileDefinitions.defaultExtensions
in your config/cms.php
file.
If you use a upload widget in the image
mode make sure to add your extension to the imageExtensions
key as described in the section above.
// add in config/cms.php
// ...
'fileDefinitions' => [
'defaultExtensions' => [
// your new custom extensions
'json',
// defaults
'jpg',
'jpeg',
'bmp',
'png',
'webp',
'gif',
'svg',
'js',
'map',
'ico',
'css',
'less',
'scss',
'ics',
'odt',
'doc',
'docx',
'ppt',
'pptx',
'pdf',
'swf',
'txt',
'xml',
'ods',
'xls',
'xlsx',
'eot',
'woff',
'woff2',
'ttf',
'flv',
'wmv',
'mp3',
'ogg',
'wav',
'avi',
'mov',
'mp4',
'mpeg',
'webm',
'mkv',
'rar',
'xml',
'zip',
]
]
There are no comments yet
Be the first one to comment