FileUpload::checkType PHP Method

checkType() protected method

检查文件类型
protected checkType ( )
    protected function checkType()
    {
        $ext = $this->instance->extensionName;
        if ($this->type == '*') {
            return true;
        } elseif (in_array($ext, $this->type)) {
            return true;
        } else {
            $this->addError('type', '文件类型不支持');
            return false;
        }
    }