myxland / think-uploader
Thinkphp5.1 FileUpload Library
Installs: 56
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:think-extend
Requires
- php: >=5.6.0
- aliyuncs/oss-sdk-php: ~2.0
- qiniu/php-sdk: *
- upyun/sdk: *
This package is not auto-updated.
Last update: 2025-03-30 07:51:28 UTC
README
安装
composer require myxland/think-uploader:dev-master
php think uploader:config
用法
<?php
use myxland\uploader\Upload;
$upload = new Upload();
/**
* 参数:
* 1、上传类型 [image, video, file]等,需要在uploader.php中定义,参照'default'
* 2、上传的字段名,即:form里的name
* 3、前缀,用于云存储,文件夹分割
* 4、文件名
*/
$result = $upload->upload();
if (!$result) {
$this->error($upload->getError());
}