On Feb 3, 8:52*pm, petersprc <peters...@gmail.comwrote:
Hi,
Try using fread with this function:
function sendFile($path)
{
* $ok = true;
* $file = fopen($path, 'rb');
* if (!$file) {
* * $ok = false;
* } else {
* * while (!feof($file)) {
* * * if (($buf = fread($file, 131072)) === false) {
* * * * $ok = false;
* * * * break;
* * * }
* * * echo $buf;
* * * flush();
* * }
* * if (!fclose($file)) {
* * * $ok = false;
* * }
* }
* return $ok;
}
On Feb 3, 1:48 pm, Bruno Rafael Moreira de Barros
<brunormbar...@gmail.comwrote:
I am trying to send a file's contents to the browser, the file is
80MB, but I can only download 6.99, then the file ends. I used
set_time_limit(0), but it still happens... Any help? Thanks in advance.-Hide quoted text -
- Show quoted text -
I dont think I understand this function completely, but what I do is
basically the same...
I open a file, get 4KB and send the 4KB, then repeat. What I dont do
is while !feof, I just do while fread 4KB...
Could that be the problem?