PHPackages                             chziyun/think6-oss - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. chziyun/think6-oss

ActiveLibrary[File &amp; Storage](/categories/file-storage)

chziyun/think6-oss
==================

thinkphp6文件上传oss整合

v1.0.1(6y ago)17721[1 issues](https://github.com/chziyun/think6-oss/issues)MITPHPPHP &gt;=7.1.0

Since Dec 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/chziyun/think6-oss)[ Packagist](https://packagist.org/packages/chziyun/think6-oss)[ RSS](/packages/chziyun-think6-oss/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

think6-oss
==========

[](#think6-oss)

thinkphp6文件上传oss整合

支持
--

[](#支持)

1. 本地存储
2. 七牛云
3. 阿里云

包含
--

[](#包含)

1. php &gt;= 7.1
2. thinkphp &gt;=6.0.0
3. aliyuncs/oss-sdk-php &gt;= 2.3
4. qiniu/php-sdk &gt;= 7.2

安装
--

[](#安装)

第一步：

```
$ composer require chziyun/think6-oss
```

第二步： 在config/filesystem.php中disks数组下添加

```
'aliyun' => [
    'type'         => 'aliyun',
    'accessId'     => '******',
    'accessSecret' => '******',
    'bucket'       => 'bucket',
    'endpoint'     => 'oss-cn-hongkong.aliyuncs.com',
    'url'          => 'http://oss-cn-hongkong.aliyuncs.com',
],
'qiniu'  => [
    'type'      => 'qiniu',
    'accessKey' => '******',
    'secretKey' => '******',
    'bucket'    => 'bucket',
    'url'       => 'http://oss.s3-cn-east-1.qiniucs.com',
]

```

使用
--

[](#使用)

```
use chziyun\Filesystem;

$file = $this->request->file('file');
$filesystem = new Filesystem($file);
// 上传到默认磁盘
$fileName = $filesystem->upload();
// 指定上传位置并保存到数据库
$fileName = $filesystem->setDisk('qiniu')->addFilesystem('image')->upload();
echo $fileName;

```

调用addFilesystem()可以保存文件信息到数据库 表结构如下

```
CREATE TABLE `filesystem` (
  `file_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `storage` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '存储位置',
  `file_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '访问地址',
  `file_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文件名称',
  `file_size` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '大小',
  `file_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文件类型',
  `extension` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文件后缀',
  `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`file_id`),
  UNIQUE KEY `path_idx` (`file_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

```

感谢
--

[](#感谢)

1. thinkphp
2. aliyuncs/oss-sdk-php
3. qiniu/php-sdk

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Total

2

Last Release

2312d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/07b5c8adc87f4d4e7402a0f02e0f644b7accd0193d12c431fef6cada30118d9e?d=identicon)[chziyun](/maintainers/chziyun)

---

Top Contributors

[![blade0910](https://avatars.githubusercontent.com/u/26991472?v=4)](https://github.com/blade0910 "blade0910 (4 commits)")

---

Tags

ossthinkphp6

### Embed Badge

![Health badge](/badges/chziyun-think6-oss/health.svg)

```
[![Health](https://phpackages.com/badges/chziyun-think6-oss/health.svg)](https://phpackages.com/packages/chziyun-think6-oss)
```

###  Alternatives

[jacobcyl/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

523566.2k7](/packages/jacobcyl-ali-oss-storage)[iidestiny/flysystem-oss

Flysystem adapter for the Oss storage.

95607.5k26](/packages/iidestiny-flysystem-oss)[yangyifan/upload

上传 SDK for Laravel

12422.6k3](/packages/yangyifan-upload)[alphasnow/aliyun-oss-flysystem

Flysystem adapter for the Aliyun storage

14249.2k4](/packages/alphasnow-aliyun-oss-flysystem)[summergeorge/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

3915.5k](/packages/summergeorge-ali-oss-storage)[yiier/yii2-aliyun-oss

Yii2 阿里云 OSS

445.3k2](/packages/yiier-yii2-aliyun-oss)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
