Page 1 of 1

How to Download Large files using php

Posted: Sun May 16, 2010 10:19 am
by dinakar
Please help me to to know how to download a large file ( size 500mb) using php
i had used the following code which dosent work for me for downloading large files

$fd = fopen ($file, "r");
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
fclose ($fd);

Re: How to Download Large files using php

Posted: Sun May 16, 2010 10:48 am
by Eran
Naturally for large files you will time out before completing the download. The default time limit for PHP is 60 seconds. You can change the time limit using set_time_limit() (a zero value will disable it completely). You can only do that though if your server is not running in safe mode