php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9468 fread stops reading
Submitted: 2001-02-26 14:40 UTC Modified: 2001-02-27 08:29 UTC
From: stock at cargo-partner dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.0.4 OS: w2k
Private report: No CVE-ID: None
 [2001-02-26 14:40 UTC] stock at cargo-partner dot com
i am using php 4.0.4 (build 20.12.2000) on w2k (build 2195)with iis5.
pls. note that fread function has a problem reading a binary file (*.zip) afer uploading.
fread stops after reading 389 bytes instead of reading the whole file using following code:

$filesize=filesize($path . "/" . $attachment_name);
$filenum=fopen($path . "/" . $attachment_name,"r");
$filestuff=fread($filenum,$filesize);
fclose($filenum);

pls. help

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-27 08:29 UTC] sniper@php.net
$filenum=fopen($path . "/" . $attachment_name,"rb");

Read the manual page:

http://www.php.net/fopen

Where it says:
"The mode may contain the letter 'b'. This is useful only on systems which differentiate between binary and text files (i.e., it's useless on Unix)."

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC