Re: Problem with file download/fopen/fread
| From: | Dariusz | Date: | Wed, 19 Jun 2002 22:46:58 +0000 |
| Subject: | Re: Problem with file download/fopen/fread | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-14310@lists.php.net to get a copy of this message | ||
Hi!
Already played with the ini settings. Max execution time is 300 secs and it
doesn't even work on my 100MBit LAN. Also tried playing with PHPs memory
limit setting without success. The download seems to work fine but the
downloaded file always is corrupted after a few kB.
Tried the same script at a friend's server (Win98, Apache 2.0.36, PHP 4.2.1
module) - same result.
-- Dariusz
"Ross Fleming" <r.fleming@totalise.co.uk> schrieb im Newsbeitrag
news:NGBBKEPLALMAJMOHBEIJOEDECDAA.r.fleming@totalise.co.uk...
> 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
> >
>