note 46517 modified in function.fread by danbrown
| From: | danbrown@php.net | Date: | Fri, 06 Jan 2012 21:12:43 +0000 |
| Subject: | note 46517 modified in function.fread by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185441@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:
<?php
while(!feof($file) and (connection_status()==0)) {
print(fread($file, 1024*1024));
set_time_limit(0);
flush();
}
?>
Frederico Pinho
--was--
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
http://php.net/manual/en/function.fread.php