php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20963 Files Uploaded Using PHP almost double the size of original
Submitted: 2002-12-12 10:34 UTC Modified: 2002-12-16 12:54 UTC
From: mark at patrickservices dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.2.2 OS: Linux Redhat 8.0
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mark at patrickservices dot com
New email:
PHP Version: OS:

 

 [2002-12-12 10:34 UTC] mark at patrickservices dot com
I am trying to create a web-based upload/download center for our users using PHP 4.2.2 / RedHat 7.3 / Apache 2.0.40.

All works well except when uploading files larger than approximately 1K. Larger files nearly double in size.  For example, using the pages I am developing, a file uploaded from a win2k PC with the correct size of 700,416 bytes nearly doubles after upload to the server to 1,388,544 bytes. The file is then, of course, corrupted. This happens with all types of files (TXT, DOC, MDB, XLS, ZIP, etc). 

To check webserver/network functionality, I created a PERL 5.8.0 CGI script on the same webserver and uploaded the same file from the same win2k machine and file uploading works perfectly.  No file size change or corruptions at all.

Obviously, extra characters are being inserted somehow in the stream when using PHP, but from where and when I don't know.  It may also be some type of improper CR/LF conversion during upload.  

I was even looking at the Character Sets defined in Apache, but the PERL 5.8.0 CGI script works correctly.  Improper character translations by the Apache webserver should corrupt both PERL and PHP versions of the uploaded files shouldn't they?  I am lost at this point.

All help is greatly appreciated.

Thanks.

##########  PHP Compiled Modules  ############
Running PHP 4.2.2
Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies

[PHP Modules]
yp
xml
wddx
sysvshm
sysvsem
standard
sockets
shmop
session
pspell
posix
pcre
openssl
ncurses
iconv
gmp
gettext
gd
ftp
exif
domxml
dio
dbx
dba
curl
ctype
calendar
bz2
bcmath
zlib

[Zend Modules]

##########  END PHP Compiled Modules  ############

##########  Apache Compiled Modules  ############
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c
##########  END Apache Compiled Modules  ############

NOTE: PHP compiled as dynamic module

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-12 11:13 UTC] sniper@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
 [2002-12-16 11:53 UTC] mark at patrickservices dot com
FYI - I recompiled and reinstalled the source distributions of PHP (4.2.3) and Apache (2.0.43) and files uploaded now reflect the correct size.  I uninstalled all RPM versions and recompiled from scratch with source.
 [2002-12-16 12:54 UTC] iliaa@php.net
Please use the PHP 4.3.0RC3 or the snapshots avaliable from http://snaps.php.net/ when testing. Version 4.3.0 contains numberous fixes and improvments not found in 4.2.3.
 [2003-03-05 09:29 UTC] cguillaume at cr-bourgogne dot fr
you could test it if you want ?  : 

cf http://bugs.php.net/bug.php?id=22551

(thanks to confirm if good )
 [2003-05-12 06:18 UTC] mvanbies at cs dot ucsd dot edu
This was probably a configuration problem in which Apache directives are the culprits.  Using both AddFilter and AddType options causes this to happen.  See a related case with bug 18648.  There are also comments on the PHP doc page that mention removing the filter lines (currently right near the bottom of the page).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC