note 20722 added to features.file-upload
| From: | syzme at charter dot net | Date: | Sun, 14 Apr 2002 03:30:44 +0000 |
| Subject: | note 20722 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29255@lists.php.net to get a copy of this message | ||
While working on a Linux/Apache/PHP 4.0.4.1 Machine I had to use the following code to upload a
file:
if (is_uploaded_file($HTTP_POST_FILES["userfile"]["tmp_name"])) {
$filename = $HTTP_POST_FILES['userfile']['tmp_name'];
$name = $HTTP_POST_FILES['userfile']['name']
move_uploaded_file($name, "place/to/go/$name");
} else {
echo "Possible file upload attack: filename" .
$HTTP_POST_FILES['userfile']['name'] . ".";
}
--
http://www.php.net/manual/en/features.file-upload.php
http://master.php.net/manage/user-notes.php?action=edit+20722
http://master.php.net/manage/user-notes.php?action=delete+20722
http://master.php.net/manage/user-notes.php?action=reject+20722