note 21747 deleted from function.is-uploaded-file by techtonik
| From: | techtonik@php.net | Date: | Mon, 14 Feb 2005 16:30:16 +0000 |
| Subject: | note 21747 deleted from function.is-uploaded-file by techtonik | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-85010@lists.php.net to get a copy of this message | ||
Note Submitter: gentecsys at yahoo dot com
----
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 .