I've tried several download scripts (particularly tested the ones in the notes of www.php.net/readfile) but no matter what i do the size of the file being sent is not being reported to the browser which means users don't know how much of the file is left to download or if they got the whole file.
i tried this:
function DownloadFile($file) { // $file = include path
if(file_exists($file)) {
ob_clean();
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
flush();
readfile($file);
exit;
}
}
and also a more advanced script that supports file-resuming (assuming of course the size was sent in the first place:
http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/
any ideas whats going on here? is it some kind of php or apache setting?