note 46517 added to function.fread
| From: | fpinho at hotpop dot com | Date: | Wed, 13 Oct 2004 21:21:33 +0000 |
| Subject: | note 46517 added to function.fread | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78517@lists.php.net to get a copy of this message | ||
After using the suggested function from Rasmus Schultz : mindplay(at)mindplay(dot)dk, I've just
noticed that people trying to download big files with a slow connection would get download stopped
after exactly 60seconds -> the max execution time set with php.ini.
I suggest using a bigger buffer (1024x1024), or maybe resetting the time limit within the
'while' cicle with:
set_time_limit(0);
The cicle would go like this:
while(!feof($file) and (connection_status()==0)) {
print(fread($file, 1024*1024));
set_time_limit(0);
flush();
}
Frederico Pinho
----
Manual Page -- http://www.php.net/manual/en/function.fread.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46517
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46517&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46517&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46517&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46517&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46517&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46517&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46517&report=yes
Search -- http://master.php.net/manage/user-notes.php