Re: download script
| From: | Brad Hubbard | Date: | Wed, 22 Aug 2001 00:38:33 +0000 |
| Subject: | Re: download script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63800@lists.php.net to get a copy of this message | ||
On Wed, 22 Aug 2001 10:19, AD wrote:
> Hi,
>
> I'm working on a download script
>
> header("Content-Type: application/octet-stream\n");
> header("Content-Length: $size\n");
> header("Content-Disposition: attachment; filename=\"$file\"\n");
> header("Content-Description: Download\n");
> readfile($path.$file);
>
header( "Content-Type: application/download" );
if (strstr(getenv('HTTP_USER_AGENT'), 'Netscape6' ))
header( "Content-Disposition: attachment; filename=chopper.exe" );
else
header( "Content-Disposition: filename=chopper.exe" );
$fn=fopen( "chopper.exe" , "r" );
fpassthru( $fn );
This was as close as I ever got. Still doesn't work in Konqueror but is an
acknowledged bug.
Cheers,
Brad
--
Brad Hubbard
Congo Systems
12 Northgate Drive,
Thomastown, Victoria, Australia 3074
Email: brad@congosystems.com
Ph: +61-3-94645981
Fax: +61-3-94645982
Mob: +61-419107559