note 69968 deleted from features.file-upload by colder
| From: | colder@php.net | Date: | Thu, 28 Sep 2006 11:08:29 +0000 |
| Subject: | note 69968 deleted from features.file-upload by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117768@lists.php.net to get a copy of this message | ||
Note Submitter: user at example dot com
Reason: bad code
----
Hi, I can't figure out how to work this thing. My code below is outputting the successful
message but I can't find the file in the mysite.com/tmp/ folder.
<php>
<?
$upload_dir = "/tmp/";
$upload_file = $upload_dir.basename($_FILES['filechose']['name']);
echo '<pre>';
if(move_uploaded_file($_FILES['filechose']['tmp_name'], $upload_file)) {
echo "The file ".basename( $_FILES['uploadedfile']['name'])."
has been uploaded\n";
}
else {
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
?>
</php>