Closed jinjie closed 5 years ago
Making this configuration makes sense to me. Would you like to raise a PR against the 1
branch?
@ScopeyNZ Should I add a new configuration that stores the additional file types? So users can easily add new file extensions by yml. Something like
$types = array_merge($types, self::get_additional_file_types());
I guess doing this change will also break translation of the file types?
@jinjie I realise you've already made a pull request, but to address your question I think that making the whole list part of configuration makes more sense. Things like this should usually be configurable by default when they're created. This part isn't, which may be a relic of past versions of SilverStripe. Your pull request is the right approach in my opinion =)
Docs still needs to be merged
https://github.com/silverstripe/silverstripe-framework/pull/8709
Docs are merged :)
get_file_type()
inSilverStripe\Assets\File
have limited file types supported.When I try to get a descriptive file type in my template for a uploaded file (in this case, a docx)
$File.FileType
. It returns "unknown" file type.I am thinking how this can better improved rather than maintaining a list of array value map of extensions to the descriptive name. Maybe a configurable yml file?