You are here: Re: detect bytes written on abort « PHP Programming Language « IT news, forums, messages
Re: detect bytes written on abort

Posted by Chung Leong on 10/06/36 11:36

Well, as it's not your own server you can't really modify the binary.
It doesn't sound like you need too accurate a number in any event. I
would just do something like this:

<?

ignore_user_abort(true);
$f = fopen($filename, "rb");
$sent = 0;
while($chunk = fread($f, 1024)) {
echo $chunk;
flush();
if(!connection_aborted()) {
$sent += strlen($chunk);
}
else {
/* record failure here */
break;
}
}

?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация