File download problem using Netscape 7.x
| From: | Ulrich Hacke | Date: | Thu, 02 Oct 2003 09:59:54 +0000 |
| Subject: | File download problem using Netscape 7.x | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-164713@lists.php.net to get a copy of this message | ||
Hello,
I have some files on a website which the user can download (e.g. pdf,
zip...). The files sould not bw displayes but the browser should aks the
user what to do (e.g. save it to disk, open it). My code look like this:
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=$userfile);
header("Content-Length: ".filesize($userfile));
header("Content-Transfer-Encoding: binary\n");
if($fp = fopen($userfile, "rb") fpassthru($fp);
This works fine in most browsers except Netscape 7.x. Here the file is saved
as "document.pdf.php" instead of "document.pdf". Does anyone know how to fix
this? Any help is appreciated.
Yours, Uli