note 20722 deleted from features.file-upload by hholzgra
| From: | hholzgra@php.net | Date: | Sun, 14 Apr 2002 22:23:58 +0000 |
| Subject: | note 20722 deleted from features.file-upload by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-29344@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'] . ".";
}