Properties

$fileField

$fileField : 

Type

$file

$file : 

Type

$base64

$base64 : 

Type

$config

$config : 

Type

$oriName

$oriName : 

Type

$fileName

$fileName : 

Type

$fullName

$fullName : 

Type

$filePath

$filePath : 

Type

$fileSize

$fileSize : 

Type

$fileType

$fileType : 

Type

$stateInfo

$stateInfo : 

Type

$stateMap

$stateMap : 

Type

$rootPath

$rootPath : 

Type

$error

$error : 

Type

Methods

__construct()

__construct(string  $fileField,   $type = "upload", array  $config = null) 

构造函数

Parameters

string $fileField

表单名称

$type
array $config

配置项

upload()

upload() 

save()

save(  $info) 

Parameters

$info

getFileInfo()

getFileInfo() : array

获取当前上传成功文件的各项信息

Returns

array

getError()

getError() 

parseFile()

parseFile(  $info) : mixed

解析上传信息

Parameters

$info

Returns

mixed

upFile()

upFile() : mixed

上传文件的主处理方法

Returns

mixed

upBase64()

upBase64() : mixed

处理base64编码的图片上传

Returns

mixed

saveRemote()

saveRemote() : mixed

拉取远程图片

Returns

mixed

getStateInfo()

getStateInfo(  $errCode) : string

上传错误检查

Parameters

$errCode

Returns

string

getFileExt()

getFileExt() : string

获取文件扩展名

Returns

string

getFullName()

getFullName() : string

重命名文件

Returns

string

getFileName()

getFileName() : string

获取文件名

Returns

string

getFilePath()

getFilePath() : string

获取文件完整路径

Returns

string

checkType()

checkType() : boolean

文件类型检测

Returns

boolean

checkSize()

checkSize() : boolean

文件大小检测

Returns

boolean