Using the latest version which I just purchased - 2.1.0.
If I go to the video or audio tab and try to upload, it only allows me to select image files. If I drag and drop, it complains that I can't upload files of that type.
Sounds like either your app settings or server have file type limitations? You may want to confirm with your web host that said file types are allowed. And then also confirm your app settings comply: https://octobercms.com/forum/post/setting-allowed-filetypes-for-fileupload
There is no limitation at the httpd level (my server). I've added the stuff in the thread you mentioned, but get the same results.
in cms.php:
...
'fileDefinitions' => [
'defaultExtensions' => [
...
'mp3',
'ogg',
'wav',
'avi',
'mov',
'mp4',
'mpeg',
]
],
Last updated
Interestingly enough, the .mp3 extension (which is what I am trying to upload), is already contained in ./vendor/october/rain/src/Filesystem/Definitions.php
.
Ok, this is a bug as far as I can tell. If I inspect the audio tab's dropzone element, I see this:
Note the data-file-types
show image extensions, not the audio ones.
./modules/backend/formwidgets/FileUpload.php
doesn't seem to use the audioExtensions
or videoExtensions
arrays, it just checks for a displaymode of image
, then falls back to the default list. However, that displayMode/image check returns true when I load/reload the form page, which is why I guess the audio/video tabs are only allowing image uploads.
However, in ./modules/backend/formwidgets/FileUpload.php
, if I replace this:
$types = implode(',', FileDefinitions::get($isImage ? 'imageExtensions' : 'defaultExtensions'));
with:
$types = implode(',', FileDefinitions::get('defaultExtensions'));
I can see that my overrides in config/cms.php
for defaultExtensions
is there, and the form works against it.
Hope that helps!
Last updated
We had this kind of problem recently.
This instruction changed. And version 2.0 you can find more instructions in this file:
vendor/october/rain/src/Filesystem/Definitions.php
In you config/cms.php add this code below:
'file_definitions' => [
'default_extensions' => [
'xml',
'mp3',
'ogg',
'wav',
'avi',
'mov',
'mp4',
'mpeg',
]
],
so "fileDefinitions" changed to "file_definitions"(lowercase with underline).
Just for a tip... The default extensions are:
protected function defaultExtensions()
{
return [
'jpg',
'jpeg',
'bmp',
'png',
'webp',
'gif',
'svg',
'js',
'map',
'ico',
'css',
'less',
'scss',
'ics',
'odt',
'doc',
'docx',
'ppt',
'pptx',
'pdf',
'swf',
'txt',
'ods',
'xls',
'xlsx',
'eot',
'woff',
'woff2',
'ttf',
'flv',
'wmv',
'mp3',
'ogg',
'wav',
'avi',
'mov',
'mp4',
'mpeg',
'webm',
'mkv',
'rar',
'zip'
];
}
Hope this help
1-7 of 7