SonataMediaBundle - how to upload images? SonataMediaBundle - how to upload images? symfony symfony

SonataMediaBundle - how to upload images?


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


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);}