[eluser]Jim OHalloran[/eluser]
[quote author="crikey" date="1189011132"]I guess it raises the issue though of serving the public/private images as part of an HTML page (in this case the image content itself wouldn't be output, rather a link to it, as in
[/quote]Once the images are outside the webroot you'll need to have a script which sends the images to the browser, which gives you the opportunity you need to do your access checks. If you used a URL like this in your image tags:
Code:
<img src="http://my-site.com/images/serve/1234">
You could create a controller called images, and include a function like this....
Code:
function serve($image_id) {
// Do access checks here...
// If access is allowed, figure out where the real image is from the image id...
// Output the image...
header('Content-Type: image/jpeg');
echo(file_get_contents($actual_path_to_image));
}
You can use the routes.php file to make the image URL a bit shorter if you like, but that gives you the idea.
Jim.