Hello,
I need to know how to determine how many bytes sent over http.
This is what I did so far.
ignore_user_abort(true);
header('Content-Type: application/octet-stream; name="file.pdf"');
header('Content-Disposition: attachment; filename="file.pdf"');
header('Accept-Ranges: bytes');
header('Pragma: no-cache');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-transfer-encoding: binary');
header('Content-length: ' . filesize('file/test.pdf'));
readfile('file/test.pdf');
if (connection_aborted()) {
$transfer_success = false;
$bytes_transferred = ftell($handle);
echo $bytes_transferred;
die();
}
Can anyone help me out ?
Thanks