ID: 9024
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Bogus
Bug Type: Filesystem function related
Assigned To: 
Comments:

You need to read the manual page for fopen().

http://www.php.net/fopen

where it says that in some braindead systems (like Windows)
you have to use 'b' in the mode string to be able 
to read/write binary files.

ie. like this:
fopen("the_file", "rb");

--Jani


Previous Comments:
---------------------------------------------------------------------------

[2001-01-31 05:19:44] [EMAIL PROTECTED]
i'm using the following code to read and output a file:

$fp = fopen("a_file_here", "r");
// retreive the file content
while (!feof($fp)){
        set_time_limit(5);
        // retreive the file content
        $contents = fread($fp, 1024);
        // output the content
        echo ($contents);
        flush();
}

These codes is work fine in older version(php3),
but now it cannot read the file completly.
For example the file have 1024 byte, it only can read the first 300 byte.
Also it work fine with the TEXT file. This problem only happen when i try to read a 
binary file(e.g. gif/jepg).
it seem to be stop reading when the file have a eof char data but it is not really End 
Of File.

Moreover, i'm using Apache and running module mode, but it will work fine when running 
cgi mode.


---------------------------------------------------------------------------


Full Bug description available at: http://bugs.php.net/?id=9024


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to