Bug #15613 Updated: readfile doesn't work correctly with WIndows XP

From: Date: Wed, 20 Mar 2002 12:37:21 +0000
Subject: Bug #15613 Updated: readfile doesn't work correctly with WIndows XP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-2954@lists.php.net to get a copy of this message
ID: 15613 Updated by: wez@php.net Reported By: khoukaz@web.de Status: Open Bug Type: Output Control Operating System: Windows XP (Professional) PHP Version: 4.1.1 New Comment: Does this happen if you use CGI under XP? I suspect that this might be apache related. --Wez. Previous Comments: ------------------------------------------------------------------------ [2002-03-20 06:22:27] sander@php.net Reopening. ------------------------------------------------------------------------ [2002-03-20 02:22:51] khoukaz@web.de The bug is not fixed. The problems are still present. By the way, fread doesn't work well with all files. The problems only occur under Windows XP. ------------------------------------------------------------------------ [2002-03-20 00:00:05] php-bugs@lists.php.net No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2002-03-06 04:48:51] khoukaz@web.de I could solve the problem with binary files by using fread instead of readfile: <? $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"); $fp = fopen($link, 'rb') or print('Could not open file!'); $read = fread($fp, $size) or print('Could not read file'); fclose($fp); print($read); ?> But this only works with binary files. With text files a get the same problems (see above). ------------------------------------------------------------------------ [2002-02-20 03:23:36] khoukaz@web.de Now i turned implicit_flush in the php.ini to on (see Bug #15245), but this doesn't matter. Please let me know, if you need more information. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/15613 -- Edit this bug report at http://bugs.php.net/?id=15613&edit=1

« previous php.bugs (#2954) next »