You are here: Re: Having connection timeout problem when calling a php script while downloading a file from the same server. « PHP Programming Language « IT news, forums, messages
Re: Having connection timeout problem when calling a php script while downloading a file from the same server.

Posted by just.starting@gmail.com on 10/07/31 11:36

I am specifying the name to the dowload.php.

Here is the code:

function readfile_chunked($filename)
{
$chunksize = 256*1024; // how many bytes per chunk
$buffer = '';
$handle = fopen($filename, 'rb');
if ($handle === false) {
return false;
}
fseek($handle,0);
while (!feof($handle)) {
set_time_limit(0);
$buffer = fread($handle, $chunksize);
print $buffer;
sleep(1);
}
return fclose($handle);
}

When ever I call any other single page then it seems to wait for the
download stuff to complete, and eventually timed out if the download
thing takes long time.

 

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

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