Hi,
I have some images saved in an secure folder (Order deny,allow Deny from all).
I want to display them by an simple request if the user has the permission to see it. My problem is, I don’t get it working in Yii. It’s no problem with an simple php script but in Yii the browser tells me everytime it’s a broke imagefile.
if(file_exists($filePath)) {
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header("Cache-Control: private");
header("Content-Type: image/jpg");
header('Content-Transfer-Encoding: binary');
header("Content-Length: ".filesize($filePath));
header('Connection: close');
readfile($filePath);
}
How should I send the header informations through yii controller?