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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: stock at cargo-partner dot com
New email:
PHP Version: OS:

 

 [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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC