views:

41

answers:

1

I have an application server, a database server and a file server, with the file server has its own subdomain name (i.e., file.myexample.com)

The file server stores all the images that are used in the application, the point is that I don't want the user to view those images without obtaining proper authentication first. So in a sense the access of these image resources must be properly authenticated, which means that only login users can access those images. If a anonymous user types in the URL of an image, the web application should direct him to the login page.

I am looking for PHP and Symfony examples.

+2  A: 

Use a PHP page to obtain you images, i.e. image.php?id=2345

WIthin the code for this page you can check the authentication of the user, then reutnr the image if they are allowed. You will need to specify the correct mime-type.

ck