note 94973 added to features.file-upload.post-method
| From: | michael at osu1 dot php dot net | Date: | Sat, 05 Dec 2009 17:19:50 +0000 |
| Subject: | note 94973 added to features.file-upload.post-method | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163608@lists.php.net to get a copy of this message | ||
Just a little note, when I was trying to get this to work on my webserver I got error telling me the
permissions were wrong, I checked and couldn't see anything wrong then I thought to try
"./" for my upload directory instead of the full address which was something like
"home/username/public_html/uploaddir". This will save it in the same directory as your
script for the program above thats something like
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = './';//<----This is all I changed
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
?>
I know something trivial but when your new to this, those kind of things elude you.
----
Server IP: 69.147.83.197
Probable Submitter: 86.47.25.208
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.post-method.php
Edit -- https://master.php.net/note/edit/94973
Del: integrated -- https://master.php.net/note/delete/94973/integrated
Del: useless -- https://master.php.net/note/delete/94973/useless
Del: bad code -- https://master.php.net/note/delete/94973/bad+code
Del: spam -- https://master.php.net/note/delete/94973/spam
Del: non-english -- https://master.php.net/note/delete/94973/non-english
Del: in docs -- https://master.php.net/note/delete/94973/in+docs
Del: other reasons-- https://master.php.net/note/delete/94973
Reject -- https://master.php.net/note/reject/94973
Search -- https://master.php.net/manage/user-notes.php