mardi 7 avril 2015

Sonata Media Bundle + AWS S3 - specify subdirectory?


Vote count:

0




i am using the s3 provider for the sonata media bundle. The AWS S3 storage is a static bucket with a subfolder:



s3://bucketname/subfolder


How can i access this subfolder with the sonata media bundle? Here is my config:



sonata_media:
default_context: default
db_driver: doctrine_orm
providers:
image:
filesystem: sonata.media.filesystem.s3
allowed_extensions: ['jpg', 'png', 'gif', 'jpeg']
allowed_mime_types: ['image/pjpeg','image/jpeg','image/png','image/x-png', 'image/gif']
contexts:
default: # the default context is mandatory
download:
strategy: sonata.media.security.public_strategy
mode: http

providers:
- sonata.media.provider.image

cdn:
server:
path: http://%bucket_name%.s3.amazonaws.com/subfolder

filesystem:
local:
directory: %kernel.root_dir%/../web/uploads/media
create: false
s3:
bucket: %aws_bucket_name%
accessKey: %aws_access_key%
secretKey: %aws_secret_key%
create: false
region:
storage: standard
acl: public


Where can i set the subdirectory "subfolder"? Because currently i get the following error:



Failed to determine HOME directory after trying "cd: 1: can't cd to ~" (exit code 2), referer: http://ift.tt/1Cu0JZP


when i upload an image.


Additional question: How can i display the images in the frontend?


Thanks for your feedback.



asked just now







Sonata Media Bundle + AWS S3 - specify subdirectory?

Aucun commentaire:

Enregistrer un commentaire