I have some PDF's that are only accessible to members only (they have to log in to get them). I'd like to have them show up in the browser, instead a dialog box is showing up asking to save/open the file. The PDF's are stored outside of the regular root directory. Here's the code:
$filepath='/var/www/vhosts/Reports/';
$filename='CA.pdf';
header('Content-Disposition:inline; filename="'.$filename.'"');
header('Content-type:application/octet-stream');
header('Pragma:no-cache');
header('Expires:0');
if ($file=fopen($filepath.$filename,'r')) {
fpassthru($file);
fclose($file);
I read that setting the disposition to inline should fix it, but no good. Any ideas?