Closed HannahDeWachter closed 1 year ago
In order to be able to upload .ics files, you should use extraAllowedFileExtensions
: https://craftcms.com/docs/4.x/config/general.html#extraallowedfileextensions.
extraFileKinds
is used to add extension to an existing kind/type of files or to register new kinds/types. (Kinds/types are what shows when you create an Assets
field and select "Restrict allowed file types".)
For example, if you wanted to say that .esp
files should also count as an Image (though please note that as per documentation, you would still have to add it to extraAllowedFileExtensions
too).
Please also note that the syntax for adding items via extraFileKinds
is different: https://craftcms.com/docs/4.x/config/general.html#extrafilekinds (you need to use a multidimensional array in there).
Hope this helps!
@i-just This worked. Thanks!
What happened?
Description
I want to upload an .ics file in Assets. The first error I got was
Upload failed. The error message was: “Failed to save the asset: “ics” is not an allowed file extension.”
. Then I added'extraFileKinds' => ['ics'],
in general.php. The error is nowCannot access offset of type string on string
.Steps to reproduce
'extraFileKinds' => ['ics'],
in general.phpExpected behavior
The files gets uploaded
Actual behavior
Error: Cannot access offset of type string on string
Stack trace