#24001 [Csd->Bgs]: fread limited by ca. 2.7K ?
| From: | pollita@php.net | Date: | Tue, 03 Jun 2003 21:08:36 +0000 |
| Subject: | #24001 [Csd->Bgs]: fread limited by ca. 2.7K ? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-41071@lists.php.net to get a copy of this message | ||
ID: 24001
Updated by: pollita@php.net
Reported By: eric at pitte dot de
-Status: Closed
+Status: Bogus
Bug Type: Filesystem function related
Operating System: Suse 8.2
PHP Version: 4.3.2
New Comment:
P.S. - To add to derick's response:
The reason the file read is comming out specifically at 2.7KB is that
the default chunksize for http streams is 4KB. The "missing" 1.3KB is
likely buried in the response headers.
Previous Comments:
------------------------------------------------------------------------
[2003-06-03 16:06:36] eric at pitte dot de
yes it's working on this way. Thank you
strange on my older PHP version the old syntax worked properly.
------------------------------------------------------------------------
[2003-06-03 15:55:07] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
fread() uses the MAXIMUM length as you specify, but it may chunk the
input as it likes.
Use something like:
$contents = \'\';
while (($data = fread($fp, 2048)) !== \"\") {
$contents .= $data;
}
------------------------------------------------------------------------
[2003-06-03 15:53:21] eric at pitte dot de
I'm using php4.3.2RC4 and Apache 2.0.45
using fopen / fread the reading stoped at constant 2.7KB whithout
failure report . Here my script:
$Map="http://wwwserver.de/map.gif
$karte = fopen ($Map, "rb");
$contents = fread ($karte, 1000000);
$sid = session_id();
$zeiger=fopen("temp/karte_${sid}.gif","wb");
fwrite($zeiger,$contents);
fclose($zeiger);
fclose($karte);
Any idee ?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24001&edit=1