note 69303 added to function.is-uploaded-file
| From: | VinayNagrik at osu1 dot php dot net | Date: | Wed, 30 Aug 2006 21:00:02 +0000 |
| Subject: | note 69303 added to function.is-uploaded-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116524@lists.php.net to get a copy of this message | ||
Dear group members,
I want to upload a file onto the server but don't want to use the help
of forms. I want to do the
same from opening the conenction from command line and do everything
from there on.
Here is my header info
POST /fileupload.php HTTP/1.1
User-Agent: Mozilla/5.0
Host: xx.xx.xx.xx
Accept:
text/xml,application/xml,application/xhtml+xml,
text/html;q=0.9,text/plain;qÂ=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Disposition: attachment; userfile=A.h
Content-length: 81
Where fileupad.php looks like ******************
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used
instead
// of $_FILES.
$uploaddir = '/var/www/uploads/';
$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>";
?>
******************************************************
What I noticed that the association between variable "userfile" defined in
Content-Disposition
header and the variable "usrfile" in the php script does not get created.
Can someone help me in creating this association or pointing out the missing step.\
Thanks in advance.
nagrik
----
Server IP: 64.71.164.2
Probable Submitter: 136.182.2.221 (proxied: 10.72.34.118)
----
X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HTML_MESSAGE autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.is-uploaded-file.php
Edit -- https://master.php.net/note/edit/69303
Del: integrated -- https://master.php.net/note/delete/69303/integrated
Del: useless -- https://master.php.net/note/delete/69303/useless
Del: bad code -- https://master.php.net/note/delete/69303/bad+code
Del: spam -- https://master.php.net/note/delete/69303/spam
Del: non-english -- https://master.php.net/note/delete/69303/non-english
Del: in docs -- https://master.php.net/note/delete/69303/in+docs
Del: other reasons-- https://master.php.net/note/delete/69303
Reject -- https://master.php.net/note/reject/69303
Search -- https://master.php.net/manage/user-notes.php