SonataMediaBundle - how to upload images?

后端 未结 2 519
天命终不由人
天命终不由人 2021-02-07 10:06

Probably should be titled: \"SonataMediaBundle - where\'s the missing howto?\".

I\'ve made some admin backend with sonataAdminBundle and sonataDoctrineORMAdminBundle (an

相关标签:
2条回答
  • 2021-02-07 10:15

    Considered the best practice of the imposition of file storage on a separate server. What would it send a file or a link to a file, you can use Symfony byundle https://packagist.org/packages/avtonom/media-storage-client-bundle

    if($file instanceof UploadedFile){
        $this->get('avtonom.media_storage_client.manager')->sendFile($file, $clientName, $context);
    }
    
    0 讨论(0)
  • 2021-02-07 10:33

    Maybe you can find the answer to your question in the: /admin/sonata/media/media/create?provider=sonata.media.provider.image&context=default

    I am interested to your other solution, please post code. Thanks

    0 讨论(0)
提交回复
热议问题