From: [EMAIL PROTECTED] Operating system: Windows XP (Professional) PHP version: 4.1.1 PHP Bug Type: Output Control Bug description: readfile doesn't work correctly with WIndows XP
I use a script like the following for downloading files (images, ascii, ...) : <? $link = $save_as_name = "test.tif"; // or *.bmp, *.txt, ... $size = filesize($link); header("Content-Type: application/octet-stream"); header("Content-disposition: inline; filename=\"".$save_as_name."\""); header("Content-Length: $size"); header("Content-Transfer-Encoding: binary\n"); readfile($link); // or fpassthru instead of readfile //$fp = fopen($link, "r"); //fpassthru($fp); //fclose($fp); ?> Under Win NT/2000 it works fine, but under XP i get a distorted image after downloading and opening the file. Also text files differ from the original one. I use Apache 1.3.22 and PHP 4.1.1 as module. -- Edit bug report at http://bugs.php.net/?id=15613&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=15613&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=15613&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=15613&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=15613&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=15613&r=support Expected behavior: http://bugs.php.net/fix.php?id=15613&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=15613&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=15613&r=submittedtwice