note 93337 added to function.readfile

From: Date: Thu, 03 Sep 2009 19:00:46 +0000
Subject: note 93337 added to function.readfile
Groups: php.notes 
Request: Send a blank email to php-notes+get-160201@lists.php.net to get a copy of this message
re: gaosipov at gmail dot com @ 09-Oct-2008 09:08 I had to modify your f.smartReadFile() {} to include buffer flushing after each chunk or else I would still have the same issues with malloc because the whole file would be read into a buffer before delivery. I simply changed the loop as so: <?php //... while(!feof($fm)&&$cur<$end&&(connection_status()==0)) { print fread($fm,min(1024*16,$end-$cur)); $cur+=1024*16; ob_flush(); flush(); } //... ?> ---- Server IP: 69.147.83.197 Probable Submitter: 99.57.189.177 ---- Manual Page -- http://www.php.net/manual/en/function.readfile.php Edit -- https://master.php.net/note/edit/93337 Del: integrated -- https://master.php.net/note/delete/93337/integrated Del: useless -- https://master.php.net/note/delete/93337/useless Del: bad code -- https://master.php.net/note/delete/93337/bad+code Del: spam -- https://master.php.net/note/delete/93337/spam Del: non-english -- https://master.php.net/note/delete/93337/non-english Del: in docs -- https://master.php.net/note/delete/93337/in+docs Del: other reasons-- https://master.php.net/note/delete/93337 Reject -- https://master.php.net/note/reject/93337 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#160201) next »