简体   繁体   中英

Silverstripe TTF file upload

I'm trying to have a upload field to upload TTF file to my website. But when trying to upload it fails - it says forbidden .

How can I have upload field to upload just TTF files.

You have to tell File class to allow that file type by adding it to the config, eg in mysite/_config/config.yml :

File:
  allowed_extensions:
    - ttf

You'll also have to whitelist it in your /assets/.htaccess

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM