[英]Silverstripe TTF file upload
I'm trying to have a upload field to upload TTF file to my website. 我正在尝试一个上载字段将TTF文件上载到我的网站。 But when trying to upload it fails - it says forbidden .
但是,当尝试上传失败时,它说是禁止的 。
How can I have upload field to upload just TTF files. 我如何有上载字段来仅上载TTF文件。
You have to tell File
class to allow that file type by adding it to the config, eg in mysite/_config/config.yml : 您必须通过将
File
类添加到配置中(例如在mysite / _config / config.yml中)来告诉File
类允许该文件类型:
File:
allowed_extensions:
- ttf
You'll also have to whitelist it in your /assets/.htaccess 您还必须在/assets/.htaccess中将其列入白名单
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.