#24574 [Opn->Bgs]: File corruption during file upload

From: Date: Thu, 10 Jul 2003 15:24:01 +0000
Subject: #24574 [Opn->Bgs]: File corruption during file upload
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-43649@lists.php.net to get a copy of this message
ID: 24574 Updated by: sniper@php.net Reported By: ivan at artenergy dot com -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: FreeBSD 4.7/Apache1.3.27 PHP Version: 4.3.2 New Comment: See bug #11066 (and search the bug database next time BEFORE you submit any reports) Previous Comments: ------------------------------------------------------------------------ [2003-07-10 01:02:32] ivan at artenergy dot com 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 this bug report at http://bugs.php.net/?id=24574&edit=1

« previous php.bugs (#43649) next »