Sending files to users
| From: | Jason Lavigne | Date: | Mon, 02 Oct 2000 09:08:34 +0000 |
| Subject: | Sending files to users | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-18312@lists.php.net to get a copy of this message | ||
Hello all,
I am using the following header to send a file to the users browser,
header("Content-Type: application/octet-stream");
header("Content-Length: ".filesize($sysvar_systemfilepath));
header("Content-Disposition: attachment; filename=$sysvar_sendfilename");
header("Pragma: no-cache");
header("Expires: 0");
and it almost works OK, with the exception that .html files open in the browser and I would like the
browser to not display the file but to give the user a save file window. I think that my problem is
in the Content-Type section but I have been known to be wrong before so any insights would be great.
_________________________________
Jason (Jay) Lavigne
Web Applications Developer
Stratagene Canada Ltd.
(p) 416-593-3770 ext 2771