A part of my application has display of images, and the images are not
under webroot, but protected, so that only looged in users can view
the images.
In my old plain php application, php script was checking for login and
doing a readfile($image_file_path); and I was using it as below
<a href="/scripts/getimage?name=abcd.jpg">
I am trying to migrate the app to cakephp, and I don't know how to
emulate the samething in cakephp. I have written a controller for
images (images data are stored in db table so can have a model, etc)
and try to do the samething in getImage($imagename) method.
function getImage($imagename)
{
readfile($path.DS.$imagename);
exit(); //no view rendering needed.
}
It works for one image, but after the execution, I find that the
session is no more valid. Any clue as to what is wrong or any other
ideas to implement the same? ( I cannot copy the images under webroot
for security purposes, not even in cache directory).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---