RE: [PHP] force binary files to open
| From: | Martin Towell | Date: | Wed, 07 Aug 2002 03:29:30 +0000 |
| Subject: | RE: [PHP] force binary files to open | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111467@lists.php.net to get a copy of this message | ||
Don't use echo($file), use readfile($file)
After all, the literal
"http://intranet.wesfarmers.com.au/forms/wfteldir.pdf"
is not a valid pdf
file...
Martin
-----Original Message-----
From: Michael Watts [mailto:Michael.Watts@corporate.wesfarmers.com.au]
Sent: Wednesday, August 07, 2002 12:38 PM
To: php-general@lists.php.net
Subject: [PHP] force binary files to open
Hi,
I have a pdf file that I would like to force to open in a browser, but
cant seem to work out how exactly to script it. I attempted this
<?php
$type='application/pdf';
$file='http://intranet.wesfarmers.com.au/forms/wfteldir.pdf';
Header("Content-type: $type");
echo($file);
?>
but the only output I got was a plain text page with the $file variable
on it
http://intranet.wesfarmers.com.au/forms/wfteldir.pdf
This is probably pretty obvious to anyone who knows anything about php.
I have tried the php pdf_open and pdf_open_image functions but I need to
open an exisiting pdf file, the pdf functions seem to be there to
generate a pdf file, then open it.
Does anyone know how to force the pdf file to open?
Thanks
Mike W
This email is confidential and may contain legally privileged information.
If you are not the intended recipient, you must not disclose or use
the information contained in it. If you have received this email in error,
please notify us immediately by return email and delete the document.