Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP - determine how many bytes sent over http

Is it possible in PHP to get a count of the number of bytes transmitted to the client? For example, if I'm outputting a 10 MB file, is there a way to find out if all 10 MB were sent to the client, or to see if the client interrupted the transfer partway? I know Apache will log this afterwards, but I'd like to access the data in PHP.

like image 361
Jay Avatar asked Oct 02 '09 06:10

Jay


1 Answers

Take a look at the ignore_user_abort and connection_abort function.

like image 94
Gumbo Avatar answered Oct 05 '22 23:10

Gumbo