× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




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.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.