|
|
 |
Re: FN-FORUM: PHP Download script
date posted 9th January 2008 11:33
> header("Content-Transfer-Encoding: Binary");
> header('Content-Type: application/octet-stream; =
> name=3D"'.basename($filename).'"');
> header("Cache-Control: must-revalidate, post-check=3D0, pre-check=3D0"=
);
> $date =3D date("D, d M Y H:i:s T");
> header("Last-Modified: $date");
> header("Expires: 0");
> header("Accept-Ranges: bytes");
> header("Content-Length: ".filesize($filename));
> header('Content-Disposition: attachment; =
> filename=3D"'.basename($filename).'"');
> header("Content-Description: File Transfer");
My guess is that the content-length isn't correct for some reason. I've =
=
never used the Content-Transfer-Encoding header - perhaps the web server=
=
is encoding in some other way?
You also have Accept-Ranges, which might cause some clients to use =
multiple downloads for the one file, with some starting some way though =
=
the file. There doesn't seem to be any handling of this where you stream=
=
the file, and that would cause corruption (as asking for data from halfw=
ay =
through the file would return data from the start of the file).
Can you set the Content-Type to be image/jpeg when it's a jpeg? Probably=
=
won't help, but would be more useful for the client than =
application/octet-stream.
Anthony
-- =
www.fonant.com - Quality web sites
|
 |
|