note 21747 added to function.is-uploaded-file

From: Date: Sat, 25 May 2002 05:54:00 +0000
Subject: note 21747 added to function.is-uploaded-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-31018@lists.php.net to get a copy of this message
I hope that this will help people that are using php over win2k .... in example like this : <?php $realname = $HTTP_POST_FILES['userfile']['name']; print $realname; $path="C:\web"; if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) { copy($HTTP_POST_FILES['userfile']['tmp_name'], "C:/web/$realname"); } else { echo "Possible file upload attack. Filename: " . $HTTP_POST_FILES['userfile']['name']; } move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], "c:/web/$realname"); ?> not the slash ! If u try "c:\" it WILL NOT WORK . using "c:/" is the answer . -- http://www.php.net/manual/en/function.is-uploaded-file.php http://master.php.net/manage/user-notes.php?action=edit+21747 http://master.php.net/manage/user-notes.php?action=delete+21747 http://master.php.net/manage/user-notes.php?action=reject+21747

« previous php.notes (#31018) next »