note 30897 deleted from features.file-upload.errors by didou
| From: | didou@php.net | Date: | Sun, 27 Jul 2003 16:06:54 +0000 |
| Subject: | note 30897 deleted from features.file-upload.errors by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-52748@lists.php.net to get a copy of this message | ||
Note Submitter: kpower at aezula dot com
----
Rather than using a switch, or if/else block, you could use an array.
$upload errors = array('File successfully uploaded', 'Uploaded file exceeds the
allowed size', 'Uploaded file exceeds the allowed size','File was only partially
uploaded, please try again', 'No file was received. Upload again.');
echo $upload_errors[$_FILES[$field_name]['error']];