Can someone well versed in the intricacies of murky HTTP magic tell me why the heck this produces corrupt downloads for some people?
$filename is and always will be a zip file, so I don't need to mess about with dynamically working out the mime-type. As far as I and Google know, application/zip is universally understood, so it can't be that. From examining the headers sent, the content-length is accurate, and the filename is being set in the content-disposition line.
The trickiest part is that I am totally unable to reproduce the errors myself; Firefox, IE, Opera and humble wget all download the zip fine and it's totally intact/well-formed. I'm totally pulling my hair out
I'd appreciate some help debugging, so if you don't mind downloading this zip file and - provided you get a corrupt file - posting your browser/OS/zip utility, I'd really appreciate it. Otherwise I'll just presume no news is good news and ignore it
Code:
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename='.basename($filename));
header('Content-Length: '.filesize($filename));
readfile($filename);
$filename is and always will be a zip file, so I don't need to mess about with dynamically working out the mime-type. As far as I and Google know, application/zip is universally understood, so it can't be that. From examining the headers sent, the content-length is accurate, and the filename is being set in the content-disposition line.
The trickiest part is that I am totally unable to reproduce the errors myself; Firefox, IE, Opera and humble wget all download the zip fine and it's totally intact/well-formed. I'm totally pulling my hair out

I'd appreciate some help debugging, so if you don't mind downloading this zip file and - provided you get a corrupt file - posting your browser/OS/zip utility, I'd really appreciate it. Otherwise I'll just presume no news is good news and ignore it
