note 105763 added to function.move-uploaded-file
| From: | julian at freeform dot ca | Date: | Tue, 13 Sep 2011 04:16:40 +0000 |
| Subject: | note 105763 added to function.move-uploaded-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183131@lists.php.net to get a copy of this message | ||
The example code on this page looks incorrect to me, but maybe I'm missing something.
Why is ["pictures"]["tmp_name"][$key] used to access info from the array? Is
the [$key] necessary? Is that a bug?
Wouldn't it be more correct to iterate over $_FILES like this:
foreach($_FILES as $fileName=>$data) {
if($data['error'] == UPLOAD_ERR_OK) {
$tmp_name = $data['tmp_name'];
// etc ??
}
}
----
Server IP: 72.55.140.6
Probable Submitter: 66.49.227.163
----
Manual Page -- http://www.php.net/manual/en/function.move-uploaded-file.php
Edit -- https://master.php.net/note/edit/105763
Del: integrated -- https://master.php.net/note/delete/105763/integrated
Del: useless -- https://master.php.net/note/delete/105763/useless
Del: bad code -- https://master.php.net/note/delete/105763/bad+code
Del: spam -- https://master.php.net/note/delete/105763/spam
Del: non-english -- https://master.php.net/note/delete/105763/non-english
Del: in docs -- https://master.php.net/note/delete/105763/in+docs
Del: other reasons-- https://master.php.net/note/delete/105763
Reject -- https://master.php.net/note/reject/105763
Search -- https://master.php.net/manage/user-notes.php