I'm not 100% sure, but try adding one more header:

Header("Content-Disposition: attachment; filename=\"" . $filename. "\"");


Ville Mattila wrote:

> Hello world,
> 
> I've made a little script which simply returns a pdf file through it (script file 
>called dl.php in the chart-directory):
> 
> <?
>  $file_size = filesize($filepath);
>  Header("Content-Type: application/pdf");
>  Header("Content-Length: ".$file_size);
> 
>  readfile($filepath);
> ?>
> 
> This script works fine when there is Acrobat Reader Browser -plug-in installed to 
>users' box so that the PDF File appears into the IE's or Netscapes' normal window. 
>But if and when user wants to save the pdf file (which should be allowed), some 
>problem appear. In the case that user right-clicks the link to this script and 
>selects "Save the file as..." (or something, I have Finnish version of IE ;) the 
>browser thinks that user is downloading chart.html -file! I suppose that same 
>"phenomenon" appears when there is no Acrobat plug-in installed and browser doesn't 
>find corresponding action for application/pdf -mime type -> it begins to download 
>file.
> 
> Any suggestions how user can download the file via that script as the file will be 
>saved as pdf-file?
> 
> Thanks and cheers,
> - Ville
> 
> 
> .................................................................
> Ville Mattila
> Ikaalinen, Finland
> gsm +358-40-8497506
> [EMAIL PROTECTED]
> www.pilotmedia.fi
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to