Reputation: 89
I am testing download functionality for which I have written a php script. This script reads a large file (10MB) using fopen and fread. Using fread I am reading a chunk of 10MB in a buffer and that buffer I am echoing and then flushing out using flush and ob_flush functions. So that client receives this buffer and I am able to check number of bytes received. This works fine in Chrome, FireFox and IE 8 but when I tested it in IE 9, the browser hangs and I am not able to get the proper downloaded bytes. Can someone suggest what are the other options that we can use to test this?
define('CHUNK_SIZE', 1024*10240);
$handle=fopen("10MBFile", 'rb');
$buffer=fread($handle, CHUNK_SIZE);
echo $buffer;
ob_flush();
flush();
Regds
Upvotes: 0
Views: 85
Reputation: 6057
I had numerous strange hangups with IE9+ and apache and could fix it with adding this stuff into httpd.conf
:
# Deal with user agents that deliberately violate open standards
#
<IfModule setenvif_module>
BrowserMatch "MSIE 10.0;" bad_DNT
</IfModule>
<IfModule headers_module>
RequestHeader unset DNT env=bad_DNT
</IfModule>
AcceptFilter https none
AcceptFilter http none
EnableSendfile Off
EnableMMAP off
Upvotes: 0