I am new in Symfony 2 and i need your help. I want to output pictures uploaded by user to web/uploads/photos
. But I dont know how I can access to that files, always get 404 error
. I read this pages:
sf 1,
sf 2, and some articles on stackoverflow, but I realy havent answer. Please can somebody explain how I can do that?
Here is some code(maybe its be useful).
Get path in controller:
$pathToImages = $this->get('kernel')->getRootDir() . '/../web';
Try to get image in view:
<img src="{{ pathToImages }}/uploads/car_photos/{{ carPhotos.path }}">