open pdf within browser via php code
Posted on 2013-06-25
Using PHP code I have created a pdf document and stored it as a file on our server.
I can open the pdf file within the browser if I access it via it's url
I can email it as an attachment and successfully open
I can't open the pdf in the browser window via a php call.
I get the following error "File doesn't begin with '%PDF-'
I have tried the following options ($file is a variable)
header('Content-Disposition: inline; filename="'.$file.'"');
header("Content-Disposition: inline; filename=".$file);
header("Content-Disposition: attachment; filename=\"".$file."\"");
I have also attempted to use absolute references rather than the variable '$file' but I haven't been successful