The download takes about a minute on our test machines. It's doubtful any user is using dialup.
Additional info:
The file on the server is correct.
Downloaded from the server to our test machines without the length header in the code shown above, the result file has the HTML of the PHP-generated download page appended to it. On some users' boxes, however, downloading without the length header truncates the download result to about 1.2MB.
Downloaded to our test machines with the length header, the file is 30290 bytes shorter than the original, and generates an "unexpected end of archive" error from winrar.
If we use an ftp script instead ...
function dlftp() {
$path = "xxx/";
$file = "yyy.rar" ;
$conn = ftp_connect( "ftpaddress") or die( "Could not connect to ftp server");
@ftp_login( $conn, "user", "pswd" ) or die( "Could not log into ftp server" );
return @readfile( ftp_get( $conn, $file, $path . $file, FTP_BINARY ));
}
... no error is raised but the download file is 10,002 bytes short.
What could be going on?