PHPackages                             duxphp/duxfiles - 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. duxphp/duxfiles

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

duxphp/duxfiles
===============

DuxPHP File management class

1.1.3(5y ago)61261Apache-2.0PHPPHP &gt;=7.0

Since Oct 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/duxphp/duxFiles)[ Packagist](https://packagist.org/packages/duxphp/duxfiles)[ Docs](http://duxphp.com/)[ RSS](/packages/duxphp-duxfiles/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (9)Dependencies (2)Versions (9)Used By (0)

 [ ![DuxShop](https://github.com/duxphp/duxphp/raw/master/docs/logo.png?raw=true) ](https://github.com/duxphp/duxfiles)

 为快速开发而生

 [ ![maven](https://camo.githubusercontent.com/635f9b9c3ea05309e4d67bcdaf1491cc7c2e0c1faf22afd28d5827820618e23d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44757846696c652d76312d626c75652e737667) ](https://github.com/duxphp/duxfiles) [ ![code style](https://camo.githubusercontent.com/1acd6576e24f5553ed3027c2fea7cf91c272f51722dbaf3d6757a8135dc3e2c3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7a6c69622d6c6963656e7365732d627269676874677265656e2e737667) ](http://zlib.net/zlib_license.html)

简介
==

[](#简介)

DuxFile 是一款PHP多存储驱动的文件管理类，支持多种云存储平台，使用 `guzzle6` 做驱动请求，摒弃各类 SDK 的臃肿，统一使用调用方便各类框架、系统使用。

支持平台
====

[](#支持平台)

- 本地服务器
- 阿里云 OSS
- 腾讯云 COS
- 七牛云存储
- 又拍云存储

环境支持
====

[](#环境支持)

- 语言版本：PHP 7.1+

讨论
==

[](#讨论)

QQ群：131331864

> 本系统非盈利产品，为防止垃圾广告和水群已开启收费入群，收费入群并不代表我们可以无条件回答您的问题，入群之前请仔细查看文档，常见安装等问题通过搜索引擎解决，切勿做伸手党

bug反馈
=====

[](#bug反馈)

[issues反馈](https://github.com/duxphp/duxfiles/issues)

版权说明
====

[](#版权说明)

本项目使用MIT开源协议，您可以在协议允许范围内进行进行商业或非商业项目使用

开发团队
====

[](#开发团队)

湖南聚匠信息科技有限公司

安装说明
====

[](#安装说明)

```
composer require duxphp/duxfiles

```

使用方法
====

[](#使用方法)

实例化

```
 $driver = \dux\files\Local::class;  //驱动类名
 $config = []; //驱动配置
 $file = new \dux\Files($driver, $config);

```

```
 \\设置保存大小，默认 10M
 $file->setSize(1048576);

```

```
 \\允许格式，默认全部，如：["jpg", "png"]
 $file->setExt([]);

```

```
 \\命名规则，默认文件名MD5，可为回调函数
 $file->setRule($rule);

```

驱动配置

```
 // 本地文件
 $driver = \dux\files\LocalDriver::class;
 $config = [
     'operator' => '', //操作员
     'password' => '', //操作员密码
     'bucket' => '',   //存储空间
     'domain' => '',   //文件域名
     'url' => '',      //接口域名
 ];

```

```
 // 阿里云 Oss
 $driver = \dux\files\OssDriver::class;
 $config = [
     'access_id' => '',
     'secret_key' => '',
     'bucket' => '',   //存储空间
     'domain' => '',   //访问域名
     'url' => '',      //接口域名
 ];

```

```
 // 腾讯云 Cos
 $driver = \dux\files\CosDriver::class;
 $config = [
     'secret_id' => '',
     'secret_key' => '',
     'bucket' => '',   //存储空间
     'domain' => '',   //访问域名
     'url' => '',      //接口域名
 ];

```

```
 // 七牛云存储
 $driver = \dux\files\QiniuDriver::class;
 $config = [
     'access_key' => '',
     'secret_key' => '',
     'bucket' => '',   //存储空间
     'domain' => '',   //访问域名
     'url' => '',      //接口域名
 ];

```

```
 // 又拍云存储
 $driver = \dux\files\UpyunDriver::class;
 $config = [
     'operator' => '', //操作员
     'password' => '', //操作员密码
     'bucket' => '',   //存储空间
     'domain' => '',   //文件域名
     'url' => '',      //接口域名
 ];

```

保存文件

```
 // $path 为文件流或者文件路径、Url
 // $name 保存文件路径名，如：\upload\dux.jpg
 // $verify 强制文件验证
 $file->save($path, $name, $verify = false);

```

删除文件

```
 // $name 保存文件路径名，如：\upload\dux.jpg
 $file->del($name);

```

异常捕获

```
 try {
     ...
 } catch (\Exception $e) {
     echo $e->getMessage();
 }

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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 ~60 days

Recently: every ~104 days

Total

8

Last Release

1976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4553e50838920d29d2d9ae7b9472761ac4f5e88d34520842a0dbb704d465b37?d=identicon)[duxphp](/maintainers/duxphp)

---

Top Contributors

[![dux-web](https://avatars.githubusercontent.com/u/2184214?v=4)](https://github.com/dux-web "dux-web (26 commits)")

---

Tags

qiniuosscosupyunduxphp

### Embed Badge

![Health badge](/badges/duxphp-duxfiles/health.svg)

```
[![Health](https://phpackages.com/badges/duxphp-duxfiles/health.svg)](https://phpackages.com/packages/duxphp-duxfiles)
```

###  Alternatives

[yangyifan/upload

上传 SDK for Laravel

12422.6k3](/packages/yangyifan-upload)[qcloud/cos-sdk-v5

PHP SDK for QCloud COS

2051.5M129](/packages/qcloud-cos-sdk-v5)[shopwwi/webman-filesystem

Flysystem V2 adapter for the webman

2715.4k5](/packages/shopwwi-webman-filesystem)[luoyy/ali-oss-storage

aliyun oss filesystem storage for laravel 9+

1529.9k1](/packages/luoyy-ali-oss-storage)

PHPackages © 2026

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