简体   繁体   中英

How to add other file extensions to SonataMediaBundle?

I need to upload other file types like (.ttf) but i can not.

Now, i'm editing the default source file configuration.php in DependencyInjection. I no it's the worst solution, but i don't know how doing that properly.

in their documentation, they don't suggest any config.

SonataMediaBundle documentation

Thanx

In your SonataMediaBundle configuration you have to add allowed_extensions and allowed_mime_types parameters.

Configuration example for file provider:

sonata_media:
    providers:
        file:
            allowed_extensions: ['ttf', 'pdf']
            allowed_mime_types: ['application/octet-stream', 'application/pdf']

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