I have a pdf file (syllabus.pdf) on the server. I have written the
following PHP code. It correctly finds the file, but it is sending the file
back as text I think because I'm seeing the binary in the browser rather
than seeing the PDF loaded by Adober Reader. I've done with with Perl, but
I've never tried this with PHP. Can someone point out what I'm doing wrong
and how to fix it so that my PHP script can serve PDFs?
<?php
header("Cache-control: no-store\n");
header("Content-type: application/pdf\n\n");
readfile("$DOCU MENT_ROOT/syllabus.pdf");
?>
Thanks
following PHP code. It correctly finds the file, but it is sending the file
back as text I think because I'm seeing the binary in the browser rather
than seeing the PDF loaded by Adober Reader. I've done with with Perl, but
I've never tried this with PHP. Can someone point out what I'm doing wrong
and how to fix it so that my PHP script can serve PDFs?
<?php
header("Cache-control: no-store\n");
header("Content-type: application/pdf\n\n");
readfile("$DOCU MENT_ROOT/syllabus.pdf");
?>
Thanks
Comment