Store Uploaded Images outside Web Directory

11 views
Skip to first unread message

Muhammad Taqi Hassan Bukhari

unread,
Apr 8, 2016, 7:09:01 AM4/8/16
to Symfony Barcelona
I want to store the symofny uploaded images/documents in the User Home Directory ~/home/muhammadtaqi/Pictures.  I have set the this parameters in my config.yml file as; below


# Twig Configuration
twig:
form:
resources:
- 'JbFileUploaderBundle:Form:fields.html.twig'

debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
globals:
media_directory: ~/home/muhammadtaqi/Pictures/


# This file is auto-generated during the composer install
parameters:
media_directory: '/home/muhammadtaqi/Pictures/'



and in the templates Em showing the images like this, 

<img src="{{ asset(media_directory~ user.avatar  )}}"
alt="" class="img-media">

but it is still pointing to the web directory?

How can it  fix this?





Reply all
Reply to author
Forward
0 new messages