I am to set up trying a fairly standard scenarion for downloading files to a browser. My PHP code generates the appropriate HTTP headers like this:
$size = filesize($file);
header("Pragma: no-cache"); // HTTP/1.0
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$f; size=$size");
header("Content-Transfer-Encoding: binary\n");
header("Content-Length: $size");
fpassthru($fp);
Using IE5.5 through an ISP dial-up connection, the transfer seems to start OK but is terminated straight away, and I get a zero-length file. If I subsequently re-load the link, the missing file contents are sent to the browser window.
This problem does not occur with Netscape 6, or with a direct LAN connection. Also, if I remove the "Content-Length" all is OK with IE5.5 (except no progress bar).
I am running PHP4.0.6 on Linux / Apache.