Problem with file download/fopen/fread

From: Date: Wed, 19 Jun 2002 20:22:52 +0000
Subject: Problem with file download/fopen/fread
Groups: php.windows 
Request: Send a blank email to php-windows+get-14307@lists.php.net to get a copy of this message
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

« previous php.windows (#14307) next »