RE: [PHP-WIN] Problem with file download/fopen/fread
| From: | Ross Fleming | Date: | Wed, 19 Jun 2002 22:11:31 +0000 |
| Subject: | RE: [PHP-WIN] Problem with file download/fopen/fread | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-14309@lists.php.net to get a copy of this message | ||
Check the resource limits in php.ini? Specifically the maximum execution
time? I copied your script as is and used it on a 12Mb zip file and it
worked fine I'm afraid. The only thing I can imagine is the execution
time... unless you're trying to download it on the same computer (which
should happen in less than a second), in which case I'm stumped.
> -----Original Message-----
> From: Dariusz [mailto:dariusz@bulgaria.com]
> Sent: 19 June 2002 21:23
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Problem with file download/fopen/fread
>
>
>
> OS: WinXP Pro
> Apache 2.0.36
> PHP 4.2.1 (module)
>
>
> A simple script:
>
> $f = "e:/web/old.zip";
> header("Content-type: application/zip");
> header("Content-Disposition: attachment; filename=old.zip");
> header("Content-Length: " . filesize($f));
> $fp = fopen($f, "rb");
> if (!$fp) exit("FILE ERROR");
> while (!feof($fp))
> {
> print fread($fp, 4096);
> }
> fclose($fp);
>
>
> The first ~8kB of the downloaded file are OK but from then on the
> downloaded
> file is totally screwed up, the filesize is correct though.
> With small files it seems to work fine (the one above is ~11MB).
>
> Also tried with readfile(..) and with fpassthru(..), doesn't work either.
>
> Anyone encountered similar problems or even better: has a
> solution to this?
>
> -- Dariusz
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>