Here's a google for serving the pdf:
https://www.google.com/search?q=php+output+pdf+stream
The trick is to either echo the file or use readfile to put it into the stream.
You can even set the header so the file is downloaded by using 'Content-Type: application/octet-stream'. Instead of rendered by using 'Content-Type: application/pdf'.
Great answer here.
https://stackoverflow.com/questions/16847015/php-stream-remote-pdf-to-client-browser
There is also some really good examples of outputting the file and even one for limiting the download rate here:
http://www.php.net/manual/en/function.readfile.php
<?php
$fullFilePath = '/path/to/file/file.pdf';
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment;filename="'.basefile($fullFilePath).'"');
readfile($fullFilePath);
exit;
Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.
-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Joe W Holt
Sent: Monday, February 12, 2018 3:10 PM
To: Web Enabling the IBM i (AS/400 and iSeries) <web400@xxxxxxxxxxxx>
Subject: Re: [WEB400] Apache Redirects to stop linking from other domains not working
Just for FYI, everything I read tells me that using the mod-rewrite for
apache can be hit and miss with PDF files due to the way browsers handle
the plugin to view them. sometimes the referrer value doesn't work, which
is what I'm running into. Most solutions point to a server streamed
document instead of a link to one, of which I've no idea how to code to
serve a PDF. If anyone can point a direction for that I'd be most grateful.
***
Regards,
Joe W Holt
Sr Programmer/Developer
Jack Onofrio Dog Shows, LLC
405.427.8181
As an Amazon Associate we earn from qualifying purchases.