|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-06-28 14:24 UTC] andi at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 23:00:01 2025 UTC |
In PHP 4.0 RC 1 running under Windows 2000 / IIS as an ISAPI module: using fread function to obtain contents of a binray file returns only a part of a file. Piece of code I used: <?php $fd = fopen("test.jpg", "r"); $size = filesize("test.jpg"); echo "<br>Filesize is: " . $size; $bdata = fread($fd, $size); $fp = fopen("bla.jpg", "w"); fwrite($fp,$bdata); fclose($fp); fclose($fd); ?> Length of text.jpg is 11755 bytes. After running the code length of bla.jpg is 65 bytes. Tries writing $bdata = fread($fd, filesize("test.jpg")); Didn't work. All examples i found at www.faqts.com use the same way to obtain contents of file. One is found at: http://www.faqts.com/knowledge-base/view.phtml/aid/161/fid/13/lang/ Thanks!