download headers
| From: | Greg Donald | Date: | Tue, 10 Oct 2000 00:18:14 +0000 |
| Subject: | download headers | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19267@lists.php.net to get a copy of this message | ||
Here's my code:
if($Format == "Unix"){
$ext = ".tar.gz";
$content_type = "application/x-gzip";
}
if ($Format == "Windows"){
$ext = ".zip";
$content_type = "application/x-zip-compressed";
}
$short_filename = "filename_v$Version$ext";
header("Content-Type: $content_type");
header("Content-Disposition: filename=$filename");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Expires: 0");
$fn=fopen("/home/src/$filename" , "r");
print fpassthru($fn);
On IE5.0 SP2, when the download dialogue appears, the suggested filename is
always named filname_v[1].tar.gz, with the extra brackets and '1' in them.
It doesn't happen in Netscape 4.74 or 6.0PR3. Any idea what kind of header
tweek I need to get the correct suggested filename in IE?
The files are downloading just fine, except the .tar.gz file always states
it has "trash at end of gzip file, decompression ended". The .tar.gz file
is not corrupt, just gives a ugly warning... Any idea?
regards,
Greg