I am using the VichUploaderBundle in my project.
I am unable to get the download link (when using the vich_file
form type) to take into account of the environment (notably dev). Which I want to do as I want to route the download function through a function.
My config is like;
vich_uploader:
db_driver: orm
twig: true
mappings:
logo_image:
uri_prefix: /foo/image
upload_destination: %kernel.root_dir%/../app/private/images
inject_on_load: false
delete_on_update: true
delete_on_remove: true
And this generates the download uri of http://example.com/foo/image/fubar.jpg
, regardless of the environment.
When in dev environment it should be http://example.com/app_dev.php/foo/image/fubar.jpg
, or in test environment
http://example.com/app_test.php/foo/image/fubar.jpg