Property | Type | Description | |
---|---|---|---|
$allowExts | 留空不作后缀检查 | ||
$allowTypes | 留空不做检查 | ||
$autoCheck | |||
$autoSub | 启用子目录保存文件 | ||
$dateFormat | |||
$hashLevel | |||
$hashType | 例如可以是 md5_file sha1_file 等 | ||
$maxSize | 上传文件的最大值 | ||
$saveName | |||
$savePath | 上传文件保存路径 | ||
$saveRule | 必须是一个无需任何参数的函数名 可以使用自定义函数 | ||
$subType | 子目录创建方式 可以使用hash date | ||
$supportMulti | 是否支持多文件上传 | ||
$thumb | 使用对上传图片进行缩略图处理 | ||
$thumbFile | 缩略图文件名 | ||
$thumbMaxHeight | 缩略图最大高度 | ||
$thumbMaxWidth | 缩略图最大宽度 | ||
$thumbPath | 缩略图保存路径 | ||
$thumbPrefix | 缩略图前缀 | ||
$thumbRemoveOrigin | 是否移除原图 | ||
$thumbSuffix | |||
$uploadReplace | 存在同名是否覆盖 | ||
$zipImages | 压缩图片文件上传 |
Method | Description | |
---|---|---|
__construct ( $maxSize = '', $allowExts = '', $allowTypes = '', $savePath = UPLOAD_PATH, $saveRule = '' ) | +---------------------------------------------------------- 架构函数 +---------------------------------------------------------- +---------------------------------------------------------- | |
getErrorMsg ( ) : string | +---------------------------------------------------------- 取得最后一次错误信息 +---------------------------------------------------------- +---------------------------------------------------------- | |
getUploadFileInfo ( ) : array | +---------------------------------------------------------- 取得上传文件的信息 +---------------------------------------------------------- +---------------------------------------------------------- | |
resetimg ( $savePath, $image_name, $save_path ) : string | +---------------------------------------------------------- 重置图片大小尺寸 +---------------------------------------------------------- +---------------------------------------------------------- | |
upload ( string $savePath = '' ) : string | +---------------------------------------------------------- 上传文件 +---------------------------------------------------------- +---------------------------------------------------------- |
Method | Description | |
---|---|---|
error ( string $errorNo ) | +---------------------------------------------------------- 获取错误代码信息 +---------------------------------------------------------- +---------------------------------------------------------- |
Method | Description | |
---|---|---|
check ( array $file ) : boolean | +---------------------------------------------------------- 检查上传的文件 +---------------------------------------------------------- +---------------------------------------------------------- | |
checkExt ( string $ext ) : boolean | +---------------------------------------------------------- 检查上传的文件后缀是否合法 +---------------------------------------------------------- +---------------------------------------------------------- | |
checkSize ( integer $size ) : boolean | +---------------------------------------------------------- 检查文件大小是否合法 +---------------------------------------------------------- +---------------------------------------------------------- | |
checkType ( string $type ) : boolean | +---------------------------------------------------------- 检查上传的文件类型是否合法 +---------------------------------------------------------- +---------------------------------------------------------- | |
checkUpload ( string $filename ) : boolean | +---------------------------------------------------------- 检查文件是否非法提交 +---------------------------------------------------------- +---------------------------------------------------------- | |
dealFiles ( array $files ) : array | +---------------------------------------------------------- 转换上传文件数组变量为正确的方式 +---------------------------------------------------------- +---------------------------------------------------------- | |
getExt ( string $filename ) : boolean | +---------------------------------------------------------- 取得上传文件的后缀 +---------------------------------------------------------- +---------------------------------------------------------- | |
getSaveName ( string $filename ) : string | +---------------------------------------------------------- 根据上传文件命名规则取得保存文件名 +---------------------------------------------------------- +---------------------------------------------------------- | |
getSubName ( array $file ) : string | +---------------------------------------------------------- 获取子目录的名称 +---------------------------------------------------------- +---------------------------------------------------------- | |
save ( $file ) : string | +---------------------------------------------------------- 上传一个文件 +---------------------------------------------------------- +---------------------------------------------------------- |
public __construct ( $maxSize = '', $allowExts = '', $allowTypes = '', $savePath = UPLOAD_PATH, $saveRule = '' ) |
public getErrorMsg ( ) : string | ||
return | string | +---------------------------------------------------------- |
public getUploadFileInfo ( ) : array | ||
return | array | +---------------------------------------------------------- |