note 100705 added to features.file-upload.errors
| From: | ChrisRush at osu1 dot php dot net | Date: | Mon, 01 Nov 2010 14:24:05 +0000 |
| Subject: | note 100705 added to features.file-upload.errors | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173655@lists.php.net to get a copy of this message | ||
@Jeff Miner
It's improper to do:
if($_FILES['userfile']['error'])
Returning an int error code is commonplace practice in the development world, as it allows you to
specify more than one error condition.
The proper way to check this would be against the Predefined Constant:
if($_FILES['userfile']['error'] == UPLOAD_ERR_OK)
----
Server IP: 64.71.164.2
Probable Submitter: 67.61.224.160
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.errors.php
Edit -- https://master.php.net/note/edit/100705
Del: integrated -- https://master.php.net/note/delete/100705/integrated
Del: useless -- https://master.php.net/note/delete/100705/useless
Del: bad code -- https://master.php.net/note/delete/100705/bad+code
Del: spam -- https://master.php.net/note/delete/100705/spam
Del: non-english -- https://master.php.net/note/delete/100705/non-english
Del: in docs -- https://master.php.net/note/delete/100705/in+docs
Del: other reasons-- https://master.php.net/note/delete/100705
Reject -- https://master.php.net/note/reject/100705
Search -- https://master.php.net/manage/user-notes.php