header() problems with IE5 file download
| From: | Sam Reid | Date: | Tue, 11 Jul 2000 08:04:53 +0000 |
| Subject: | header() problems with IE5 file download | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5874@lists.php.net to get a copy of this message | ||
Hi folks,
I'm hoping you can bring your collective wisdom to bear on this annoying
problem in a project I'm doing. This PHP-4.0.1pl2 site contains an image
archive, from which a script - download.php - can be called to gather a
number of images from the archive, zip-compress them together, then
upload them to the browser.
This all works prefectly on any browser I've tried it on except for IE5,
which (wouldn't you know it) is the platform the client is insisting on
using.
On Win98se/IE5.0a the browser starts downloading the file, displays the
progress meter, but dies at around 75% with the error "the server
returned an invalid or unrecognised response".
On Win98se/IE5.0 the browser appears to download the zip file
successfully (and the files it contains can be unzipped and viewed)
however once transfer is complete IE retains it's hourglass+arrow
pointer, and unless the user presses 'Stop' the browser eventually dies.
Essentially, what I've got is this:
<?php
...
...
$zipfile=shell_exec("zip -j -q -r - $tmppth/");
$zipsize=strlen($zipfile);
header("Content-Type: application/octet-stream; name=Skinvision.zip");
header("Content-Length: $zipsize");
header("Content-Transfer-Encoding: binary");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=Skinvision.zip\n");
echo $zipfile;
?>
There's no other output, blank lines, or anything like that to screw
with the headers as far as I can see.
This one's stumped me for a couple of days... anyone got any ideas?
Thanks,
-=Sam=-