protected function getUploadError($code)
    {
        switch ($code) {
            case UPLOAD_ERR_INI_SIZE:
            case UPLOAD_ERR_FORM_SIZE:
                return 'File too large.';
            case UPLOAD_ERR_PARTIAL:
                return 'File upload was not completed.';
            case UPLOAD_ERR_NO_FILE:
                return 'No file was uploaded.';
            case UPLOAD_ERR_NO_TMP_DIR:
                return 'Temporary folder missing.';
            case UPLOAD_ERR_CANT_WRITE:
                return 'Failed to write to disk';
            case UPLOAD_ERR_EXTENSION:
                return 'A PHP extension stopped the file upload.';
            case UPLOAD_ERR_OK:
            default:
                return 'OK';
        }
    }
protected function getUploadError($code)
    {
        switch ($code) {
            case UPLOAD_ERR_INI_SIZE:
            case UPLOAD_ERR_FORM_SIZE:
                return 'File too large.';
            case UPLOAD_ERR_PARTIAL:
                return 'File upload was not completed.';
            case UPLOAD_ERR_NO_FILE:
                return 'No file was uploaded.';
            case UPLOAD_ERR_NO_TMP_DIR:
                return 'Temporary folder missing.';
            case UPLOAD_ERR_CANT_WRITE:
                return 'Failed to write to disk';
            case UPLOAD_ERR_EXTENSION:
                return 'A PHP extension stopped the file upload.';
            case UPLOAD_ERR_OK:
            default:
                return 'OK';
        }
    }
protected function getUploadError ( $ code ) { switch ( $ code ) { case UPLOAD_ERR_INI_SIZE : case UPLOAD_ERR_FORM_SIZE : return 'File too large.' ; case UPLOAD_ERR_PARTIAL : return 'File upload was not completed.' ; case UPLOAD_ERR_NO_FILE : return 'No file was uploaded.' ; case UPLOAD_ERR_NO_TMP_DIR : return 'Temporary folder missing.' ; case UPLOAD_ERR_CANT_WRITE : return 'Failed to write to disk' ; case UPLOAD_ERR_EXTENSION : return 'A PHP extension stopped the file upload.' ; case UPLOAD_ERR_OK : default : return 'OK' ; } }
Returns the upload error message for the given error code.
@param int $code the error code.
@return string the message.
Returns the upload error message for the given error code .