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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 17:02:17 2025 UTC