Just wondering if there is a better way to add to the $allowed_extension list in File.php. It seems you used to be able to add this to your _config file, but because it's been switched to private I'm not able to do that anymore. Wondering if there is a way to add file types without editing the framework's core.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
You now use the Config API or a YAML file to do this.
The YAML syntax is:
File:
allowed_extensions:
- new_ext
- other_ext
That would go in mysite/_config/config.yml.
Thanks for that simon_w, perhaps we should add this example to the docs? Best place would probably be http://doc.silverstripe.org/framework/en/reference/uploadfield
patattrash, if this solves your problem please edit your original thread title to include [solved] prefix :)
simon_w, thanks for the quick reply and sorry I didn't notice the update earlier. That took care of it for me.
I have actually created a pull request to add this to the documentation https://github.com/silverstripe/silverstripe-framework/pull/3233