0

I have 2 web applications:

  • Administration
  • Client

I use Administration to upload photos into folder on server. And I want to load photos in Client. Img tag can read only from root directory and its subfolders, but I have files in /var/www/uploads.

Is some result for my issue?

I use Symfony2 and Twig.

EDIT: Solve is here: symfony2 store uploaded file non rootweb

Community
  • 1
  • 1
Standa Pecka
  • 87
  • 1
  • 8

1 Answers1

2

If your uploads directory isn't accessible from browser, than you gonna have to create Controller to read the file and return it as response. Luckily Symfony already provides File response which will stream the file.

More information in Symfony docs

Jindra
  • 780
  • 13
  • 39
  • thanks for your answer. But I don't want to response file to download, but get more files in the response time to display in view. Something like array of files for display. – Standa Pecka Jan 30 '15 at 15:04