Bug #15613 Updated: readfile doesn't work correctly with WIndows XP
| From: | wez@php.net | Date: | Wed, 20 Mar 2002 12:57:57 +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-2955@lists.php.net to get a copy of this message | ||
ID: 15613
Updated by: wez@php.net
Reported By: khoukaz@web.de
-Status: Open
+Status: Feedback
Bug Type: Output Control
Operating System: Windows XP (Professional)
PHP Version: 4.1.1
New Comment:
I meant to say: please try running the CGI both under
apache and from the command line.
Previous Comments:
------------------------------------------------------------------------
[2002-03-20 07:37:20] wez@php.net
Does this happen if you use CGI under XP?
I suspect that this might be apache related.
--Wez.
------------------------------------------------------------------------
[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).
------------------------------------------------------------------------
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