简体   繁体   中英

How to override default upload path of sonata media bundle in symfony?

我有以下问题,我正在使用Sonata Media捆绑软件在Symfony 2应用程序中进行媒体上传,我在Bluehost中托管了该应用程序,我的问题是,如何在Sonata Media中覆盖默认的媒体上传路径捆绑?,因为我需要上传到“ public_html”目录而不是默认的Web目录?,谢谢,谢谢。

Take a look at possible configuration of Sonata Media Bundle.

As you can see, you can provide a destination path for your media files via filesystem configuration.

Default value is:

%kernel.root_dir%/../web/uploads/media                          

Custom path (media folder is on the same level as project folder):

sonata_media:
    filesystem:
        local:
            directory:  %kernel.root_dir%/../../media
            create:     false

create : true means that a specified directory will be created if it does not exist.

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