Show a PDF files in users browser via PHP/Perl

I assume you want the PDF to display in the browser, rather than forcing a download. If that is the case, try setting the Content-Disposition header with a value of inline.

Also remember that this will also be affected by browser settings – some browsers may be configured to always download PDF files or open them in a different application (e.g. Adobe Reader)

Leave a Comment