sending PDF to the user (www)
| From: | George Pitcher | Date: | Thu, 13 Sep 2001 15:24:35 +0000 |
| Subject: | sending PDF to the user (www) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-67229@lists.php.net to get a copy of this message | ||
Hi all,
I am using Lasso to authenticate user access to PDF files with the actual
delivery being handled by PHP.
I can download the PDF by clicking a 'submit' button. However, in IE or
Netscape, it puts it into the browser with the name of the php script as the
filename. I would like the filename to be the one the file lives with
normally. Can this be done?
Also, I would like it to be downloaded to the user's computer without
opening in the browser. Any suggestions.
My coding in php is:
<?php
$fp1 = "D:\\Pdf\\" . $fp;
$len = filesize($fp1);
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=$fp1");
header("Content-Length: $len");
readfile($fp1);
?>
Any suggestions?
George Pitcher
Edinburgh
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com