sonata-media-bundle

SonataMediaBundle - S3 AWS: 'The configured bucket “my-bucket” does not exist

自闭症网瘾萝莉.ら 提交于 2020-01-01 06:34:52
问题 I'm trying to configure the AWS s3 filesystem on my Sonata-Project, but I always get the following error: The configured bucket "my-bucket" does not exist. My sonata_media.yml : cdn: server: path: http://%s3_bucket_name%.s3-website-%s3_region%.amazonaws.com providers: image: filesystem: sonata.media.filesystem.s3 file: resizer: false allowed_extensions: ['pdf'] allowed_mime_types: ['application/pdf', 'application/x-pdf'] filesystem: s3: bucket: %s3_bucket_name% accessKey: %s3_access_key%

SonataMediaBundle - S3 AWS: 'The configured bucket “my-bucket” does not exist

大城市里の小女人 提交于 2020-01-01 06:34:04
问题 I'm trying to configure the AWS s3 filesystem on my Sonata-Project, but I always get the following error: The configured bucket "my-bucket" does not exist. My sonata_media.yml : cdn: server: path: http://%s3_bucket_name%.s3-website-%s3_region%.amazonaws.com providers: image: filesystem: sonata.media.filesystem.s3 file: resizer: false allowed_extensions: ['pdf'] allowed_mime_types: ['application/pdf', 'application/x-pdf'] filesystem: s3: bucket: %s3_bucket_name% accessKey: %s3_access_key%

Add constraints in upload image : SonataMediaBundle

烂漫一生 提交于 2019-12-24 07:16:53
问题 How can I add constraints to upload an image, for example : max size, error message, there is not thing about that in the config of sonata_media. thank you very much. 回答1: First you will use the CompilerPassInterface component to override the SonataMediaBundle's MediaAdmin class as per link: Overriding the part of bundle supose you are in AcmeDemoBundle: <?php namespace Acme\DemoBundle\DependencyInjection; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony

Sonata Media Bundle remove gallery

ぃ、小莉子 提交于 2019-12-23 21:14:16
问题 I have the Sonata Media Bundle installed but I don't use the gallery portion of the bundle. How do I disable the Gallery? I am using Symfony 2.3 and I have the standard Media Bundle install as per the documentation. Solution thus far: If you look at this issue https://github.com/sonata-project/SonataAdminBundle/issues/460 from the admin bundle you can disable a admin by adding the show_in_dashboard: false tag to the yaml file. To do this I simply add my own compiler that adds this flag for me

SonataMediaBundle - How to use custom file input

*爱你&永不变心* 提交于 2019-12-23 20:45:15
问题 I have a kind of scavenger hunt project in which I am using AngularJS to manage the different questions it may contain. These questions are of different types. Therefore, some may include a file input and some may not. In this project, I am also using Symfony and SonataMediaBundle to manage my files and my images. Since my html model (mostly my forms) can change depending on the actions of the user, I cannot use Symfony's built-in tool to produce forms. Therefore, all my forms are custom made

No thumbnails generated

随声附和 提交于 2019-12-23 12:11:51
问题 I am using Sonata Media Bundle with Symfony2.3 in my project. When I override youtube provider sonata.media.provider.youtube . Everything working fine. No errors or anything but in /Web/uploads/media no thumbnails generated but in my admin dashboard show me : /uploads/media/default/0001/01/thumb_9_default_small.jpg. I don't know how but when I am not override sonata.media.provider.youtube then thumbnails generated in /web/uploads/media/ Like : /web/uploads/media/default/0001/01/thumb_9

How to remove category from sonata_type_model_list at url @admin_sonata_media_media_create

妖精的绣舞 提交于 2019-12-23 04:55:16
问题 I'm using Media in User Entity(avatar). At first I used sonata_media_type. It worked good. The problem is I'm using ManyToOne - so the admin can select one from the list. To achieve this I have to use sonata_type_model_list - this has list,new,delete actions. I removed delete by 'btn_delete' => ''. Here the list action works good(up to now). The real PROBLEM is at new action. The new action window load from ajax - and it has File/Reference, Category (Two fields). Here I need to remove

SonataMediaBundle: How to add svg file extension

柔情痞子 提交于 2019-12-12 12:09:59
问题 I need to add .svg file extension to my configuration. At the moment in my project I have other extensions as (pdf, images) I made the following changes Added a new svg_file to the context Added the file provider (In the end of configuration file) Added the svg in allowed_extensions Added the image/svg+xml in allowed_mime_types Now, I can upload the svg file but the problem is that the user can upload other file extensions for example pdf etc.. How can avoid it? Or find a proper way for the

SonataMediaBundle Custom Provider

偶尔善良 提交于 2019-12-12 05:19:53
问题 I'm trying to create two custom providers, one for PDF and another one for ZIP files. This is my code. services.yml parameters: application_sonata_media.zip_class: Application\Sonata\MediaBundle\Provider\ZipProvider services: sonata.media.provider.zip: class: %application_sonata_media.zip_class% tags: - { name: sonata.media.provider } arguments: - sonata.media.provider.zip - @sonata.media.filesystem.local - @sonata.media.cdn.server - @sonata.media.generator.default - @sonata.media.thumbnail

How to override Sonata Media Bundle templates?

喜你入骨 提交于 2019-12-11 10:08:00
问题 I'm currently using SonataAdminBundle for the creation of a Back Office and I've integrated SonataMediaBundle (app-dev version) 2 days ago. The edit/create template from sonata bundle however has some errors! I've fixed them (and they are just twig errors). But I can't just make the changes in the vendor. What is the correct way to overwrite the SonataMediaBundle templates? I've tried the classic AdminBundle way but it doesn't work! here's the code: sonata.admin.media: class: Acme\AdminBundle