i am running also OS: WinXP Pro Apache 2.0.36 PHP 4.2.1 (module)
if i replace: while(!feof($fc)) { set_time_limit(5); echo fread($fc, 10240); flush(); } with this echo fread($fc, $file_size); it works fine. But now we have an other problem: memmory limit, etc. In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > >Hi, > >I have the same problem > >Mail me if you have an idee ([EMAIL PROTECTED]) > > if (!($fc = fopen($base_path . $path . $file, "rb"))) { > echo "error\n"; > exit; > } > $file_size = filesize($base_path . $path . $file); > > ob_end_clean(); > ignore_user_abort(false); > > if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')){ > // IE cannot download from sessions without a cache > header('Cache-Control: public'); > } > header("Content-type: application/octet-stream"); > header("Content-Disposition: attachment; filename=\"".$file."\""); > header("Content-length: ".(string)($file_size)); > if ($description!="") { > header("Content-Description: " . $description); > } > > while(!feof($fc)) { > set_time_limit(5); > echo fread($fc, 10240); > flush(); > } > > fclose($fc); > exit; > > > >In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... >> >> >>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