|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-03-19 04:20 UTC] sander@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
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.