For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > March 2004 > opening pdf file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author opening pdf file
sebastian

2004-03-26, 11:12 pm

Hi.

I need some help with this:

there is a link to open pdf file:

script.php?file=sth.pdf



content of script.php:

$fp = fopen ($file, "rb");
header ("Content-Transfer-Encoding: binary");
header ("Content-Type: application/pdf");
header ("Content-Disposition: inline; filename=$file");
header ("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
header ("Content-Description: $file");
header ("Content-Length: $size");
fpassthru ($fp);
fclose ($fp);


Everything with openeing .pdf file is ok. Problem is with name of this file.
When I click in Adobe Acrobat "Save Copy As" deafult file name is

script.php_file=sth.pdf

How to change default filename?

In addition - when I right click on link, and select "Save target as"
dafault filename is ok (in this case sth.pdf).
Have you got any ideas? I'll be very grateful.


Thanks,
sebastian


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com