note 50551 added to function.move-uploaded-file
| From: | joven_cm at yahoo dot com | Date: | Thu, 03 Mar 2005 06:03:43 +0000 |
| Subject: | note 50551 added to function.move-uploaded-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85841@lists.php.net to get a copy of this message | ||
can anyone give me the answer to my problem with this code? i tried it but it doesn't work. may
be i have a logical error or the destination address
<?php
$file_realname = trim($_FILES['userfile']['name']);
$uploaddir = "/";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir .
$file_realname)) {
print "Received {$_FILES['userfile']['name']} - its size is
{$_FILES['userfile']['size']}";
} else {
print "Upload failed!";
}
if (is_uploaded_file($_FILES['userfile']['name'])) {
copy($_FILES['userfile']['tmp_name'], $uploaddir . $file_realname);
}
else {
print "copy failed!";
}
?>
thank you in advance. ^_^
----
Manual Page -- http://www.php.net/manual/en/function.move-uploaded-file.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50551
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50551&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50551&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50551&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50551&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50551&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50551&report=yes
Search -- http://master.php.net/manage/user-notes.php