note 101479 deleted from features.file-upload by googleguy
| From: | googleguy@php.net | Date: | Wed, 22 Aug 2012 01:44:43 +0000 |
| Subject: | note 101479 deleted from features.file-upload by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190164@lists.php.net to get a copy of this message | ||
Note Submitter: joehopf at gmail dot com
----
Please be aware that if you do a comparision like ($error == UPLOAD_ERR_OK) you are NOT on the safe
side!
The official example is fine, because I executes a loop for all $_FILES entries. But if you only
expect one file and you check $_FILE['something']['error'] == UPLOAD_ERR_OK
directly, it will true even if no file was uploaed, because the constant is zero!
So please do $_FILE['something']['error'] === UPLOAD_ERR_OK!