From:             ivan at artenergy dot com
Operating system: FreeBSD 4.7/Apache1.3.27 
PHP version:      4.3.2
PHP Bug Type:     Filesystem function related
Bug description:  File corruption during file upload

Description:
------------
Uploading files, e.g. JPGs or GIFs, using HTML form/PHP interface results
in corrupted files.

Reproduce code:
---------------
HTML form fragment:
...
<form method="post" enctype="multipart/form-data"
action="update.php"><input type="file" name="image">
....

update.php fragment:
...
copy("$image", "/www/image/$image_name") or die("Couldn't upload
$image_name !");
...

Expected result:
----------------
Selected local file uploaded to the web server as 
"/www/image/$image_name"

Actual result:
--------------
File is indeed uploaded, file length is correct, but it is
corrupted. 
Typically all 0x00 bytes are replaced with 0x20.

-- 
Edit bug report at http://bugs.php.net/?id=24574&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24574&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24574&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=24574&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24574&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24574&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24574&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24574&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24574&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24574&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24574&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24574&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24574&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24574&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24574&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24574&r=gnused

Reply via email to