27 Aug, 2007, Guest wrote in the 1st comment:
Votes: 0
[php]<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=qsfportal-1.4.0.tar.gz");
header("Content-Length: " . filesize("./qsfportal-1.4.0.tar.gz") );
header("X-Robots-Tag: noarchive, nosnippet, noindex");
echo file_get_contents( './qsfportal-1.4.0.tar.gz');
?>[/php]

I've been having a strange downloading problem with PHP that I've managed to narrow down to the above snippet. If IE7, IE6, Opera 9.23, or lynx attempts to follow a link to www.example.com/download_test.php the file fails to completely transfer. When going to www.example.com/qsfportal-1.4.0.tar.gz the file transfers through fine. So I think I've reasonably eliminated an Apache problem.

Firefox 2.0.0.6 has no issues downloading the file using either method, repeatedly.

Can anyone shed some light on what might be going wrong?

BTW, this is in relation to our problem here with "corrupted" downloads. They're not really corrupted. They're victims of this problem.
29 Aug, 2007, Guest wrote in the 2nd comment:
Votes: 0
http://forums.codewalkers.com/php-coding... in case anyone is interested in following along as I seek help for this :P
30 Aug, 2007, Tyche wrote in the 3rd comment:
Votes: 0
I did the send_file code for the Nitro framework and it works on Opera, IE 6.0 and Firefox.

I do set some headers differently…
@context.response_headers["Cache-control"] = 'private'
@context.response_headers["Content-Length"] = "#{File.size?(f) || 0}"
@context.response_headers["Content-Type"] = 'application/force-download'
0.0/3