Re: Displaying PDF file
| From: | Joseph Szobody | Date: | Thu, 12 Sep 2002 15:35:53 +0000 |
| Subject: | Re: Displaying PDF file | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116172@lists.php.net to get a copy of this message | ||
Ok.... I think it's working now. When I click the link going directly to the PHP script,
it's displaying the PDF file in the browser appropriately. Exactly what I want.
Now.... some of these PDF docs are so big, they could take a while to show up if a client is on a
slow connection. So now I want to make a 'middle' page that says something like
'dowloading... please be patient' while the PDF is downloading. So here's what
I've done.
The file getpdf1.php is the following:
<meta http-equiv="refresh" content="0;URL=getapdf2.php">
Please be patient... downloading
getpdf2.php is:
Header("Content-type: application/pdf");
$file = fopen("../pdfs/whatever.pdf",rb);
fpassthru($file);
fclose($file);
(Thanks to James for this little bit of code)
Now... if I link directly to getpdf2.php, it works great. However if I link to getpdf1.php, which
redirects to getpdf2.php, IE show the download file dialog. This is NOT what I want, why is this?
Weird.
Joseph