From: [EMAIL PROTECTED] Operating system: Windows 2000 PHP version: 4.1.2 PHP Bug Type: Filesystem function related Bug description: Uploaded file corrupted
I have PHP 4.1.2 (binary distribution from www.php.net) and Apache/1.3.22 Server running under Windows NT 5.0 build 2195 (Windows 2000). I have a problem: uploaded files seem to be corrupted, namely, all bytes with values '0x0' in original file are changed to values '0x20' in uploaded one, so only binary files are corrupted, text files are OK. Form used: <form method="POST" action="./upload.php" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="65536"> <input name="uploadfile" type="file" size="40"> <br><br> <input type="submit" value="Send"> The script is: $tmpname=preg_replace("/\\\/", "/", $_REQUEST["uploadfile"]["tmp_name"]); preg_match("/\..*/", $_REQUEST["uploadfile"]["name"], $match); copy($tmpname, $tmpname . $match[0]); Thanks for any help. -- Edit bug report at http://bugs.php.net/?id=16161&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16161&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16161&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16161&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16161&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16161&r=support Expected behavior: http://bugs.php.net/fix.php?id=16161&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16161&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16161&r=submittedtwice