php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26094 Filesize of downloaded file larger then the original file size
Submitted: 2003-11-03 05:32 UTC Modified: 2003-11-03 13:43 UTC
From: uwe dot beier at zf dot com Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.3.3 OS: WinXP Prof.
Private report: No CVE-ID: None
 [2003-11-03 05:32 UTC] uwe dot beier at zf dot com
Description:
------------
while downloading a file with the header function, the size of the downloaded file is between 100 and 1000 bytes larger, than the original file on the server. 
PHP version is 4.3.3 and Webserver is IIS 5.0 (OS: WinXP). The same problem occured with PHP 4.3.2 on an Apache 1.3.28 and was fixed by updating PHP to version 4.3.3

There are no blank lines after the last line and there are no include files or auto_prepend files.

Reproduce code:
---------------
<?PHP
  $name="E:/ftpx/test/20031013_standards_proe.tgz";
  $save_as_name = basename($name);

  header("Cache-control: private");
  header("Content-Type: application/octet-stream");
  header("Content-Disposition: filename=$save_as_name");
  header("Content-Transfer-Encoding: binary");
  header("Content-length: " . filesize($name));
  header("Pragma: public");
  echo readfile($name);
?>

Expected result:
----------------
the original size is 158.994.464 Bytes, the downloaded file has 158.994.600 Bytes.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-03 05:39 UTC] moriyoshi@php.net
Most likely you have turned on session.use_trans_sid. Check your php.ini.


 [2003-11-03 05:49 UTC] uwe dot beier at zf dot com
session.use_trans_sid was on and is now turned off. 
After the restart of the webserver the bug can be still reproduced!
 [2003-11-03 13:43 UTC] sniper@php.net
PHP does not cause this. (works fine for me)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 12:01:27 2024 UTC