note 85918 added to function.move-uploaded-file
| From: | Anonymous at osu1 dot php dot net | Date: | Wed, 24 Sep 2008 16:07:11 +0000 |
| Subject: | note 85918 added to function.move-uploaded-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144675@lists.php.net to get a copy of this message | ||
When using this function to move new uploads, it apparently can fail if you name the destination
file with a filename (this excludes any path to the file) other than the actual name of the upload.
So:
<?move_uploaded_file($_FILES['userfile']['tmp_name'],
'../somedir/'.$_FILES['userfile']['name']);?>
Will work without a hitch, while
<?move_uploaded_file($_FILES['userfile']['tmp_name'],
'../somedir/someoddfilename.txt');?>
will return true, yet not move the file to the new filename.
I am unsure wether this is solely a windows 'error', or is a generic php flaw.
It doesn't appear to act this way with all file-types, and even individual files may be
excepted.
----
Server IP: 89.248.170.61
Probable Submitter: 62.194.189.172
----
Manual Page -- http://www.php.net/manual/en/function.move-uploaded-file.php
Edit -- https://master.php.net/note/edit/85918
Del: integrated -- https://master.php.net/note/delete/85918/integrated
Del: useless -- https://master.php.net/note/delete/85918/useless
Del: bad code -- https://master.php.net/note/delete/85918/bad+code
Del: spam -- https://master.php.net/note/delete/85918/spam
Del: non-english -- https://master.php.net/note/delete/85918/non-english
Del: in docs -- https://master.php.net/note/delete/85918/in+docs
Del: other reasons-- https://master.php.net/note/delete/85918
Reject -- https://master.php.net/note/reject/85918
Search -- https://master.php.net/manage/user-notes.php