#21819 [Opn]: Corrupted uploaded binary files
| From: | sniper@php.net | Date: | Thu, 23 Jan 2003 02:03:43 +0000 |
| Subject: | #21819 [Opn]: Corrupted uploaded binary files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-30995@lists.php.net to get a copy of this message | ||
ID: 21819
Updated by: sniper@php.net
Reported By: ele@roundex.com
Status: Open
-Bug Type: HTTP related
+Bug Type: Apache2 related
Operating System: Linux RedHar 8.0
-PHP Version: 4.3.0
+PHP Version: 4.3.1
New Comment:
I guess the problem (again) is apache2. It's really not ready for
production yet, so you should consider using
Apache 1.3.27 which really works..
Reclassified.
Previous Comments:
------------------------------------------------------------------------
[2003-01-22 16:07:04] ele@roundex.com
The script goes like this:
<html>
<body>
<?
echo $_FILES['userfile']['name']." ";
echo $_FILES['userfile']['type']." ";
echo $_FILES['userfile']['size']." ";
echo $_FILES['userfile']['tmp_name']." ";
echo $_FILES['userfile']['error']." ";
if (move_uploaded_file($_FILES['userfile']['tmp_name'],
"/var/www/hosts/se8.org/htdocs/temp/image.jpg")) {
echo "moved";
} else {
echo "not_moved";
}
?>
<p>
<form action="test.php" method="post"
enctype="multipart/form-data">
<input type="file" name="userfile">
<input type="submit">
</form>
</body>
</html>
When I upload a 11463 byte image, it grows to 22575 bytes and corrutps.
------------------------------------------------------------------------
[2003-01-22 15:44:58] iliaa@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
Please provide the script you are using to upload the files and the
script used to handle the actual files uploads.
------------------------------------------------------------------------
[2003-01-22 08:59:41] ele@roundex.com
When uploading binary files (about 5kB and up), they get corrupted, not
the whole file but some way from the beginning. The size is increased
about 90%, actual number of bytes varies with different browsers.
PHP versions tried: 4.3.0 and 4.3.1-dev (200301211230).
Configured with './configure' '--with-apxs2' '--with-openssl'
'--enable-calendar' '--with-curl' '--with-gd'
'--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib'
'--enable-mime-magic' '--with-mysql' '--enable-magic-quotes'
'--with-zlib-dir=/usr/lib' '--with-config-file-path=/etc'
Apache version: 2.0.43
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21819&edit=1