PHPackages                             overtrue/flysystem-cos - 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. overtrue/flysystem-cos

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

overtrue/flysystem-cos
======================

Flysystem adapter for the QCloud COS storage.

5.2.0(7mo ago)80788.9k—3.1%12[4 issues](https://github.com/overtrue/flysystem-cos/issues)20MITPHPPHP &gt;=8.0.2CI passing

Since Mar 12Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/overtrue/flysystem-cos)[ Packagist](https://packagist.org/packages/overtrue/flysystem-cos)[ GitHub Sponsors](https://github.com/overtrue)[ RSS](/packages/overtrue-flysystem-cos/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (32)Used By (20)

Flysystem QCloud COS
====================

[](#flysystem-qcloud-cos)

---

💾 Flysystem adapter for the Qcloud COS storage.

[![Test](https://github.com/overtrue/flysystem-cos/actions/workflows/test.yml/badge.svg)](https://github.com/overtrue/flysystem-cos/actions/workflows/test.yml) [![Latest Stable Version](https://camo.githubusercontent.com/cf355f9bf8742e172f19c87031a5ebcf1eb2bd3c2a4942094be7d43cdd96b340/68747470733a2f2f706f7365722e707567782e6f72672f6f766572747275652f666c7973797374656d2d636f732f762f737461626c652e737667)](https://packagist.org/packages/overtrue/flysystem-cos) [![Latest Unstable Version](https://camo.githubusercontent.com/c116dac52a3dad7480fe83a6fceacd06d72e132af4414052565237ce44efe2e3/68747470733a2f2f706f7365722e707567782e6f72672f6f766572747275652f666c7973797374656d2d636f732f762f756e737461626c652e737667)](https://packagist.org/packages/overtrue/flysystem-cos) [![Total Downloads](https://camo.githubusercontent.com/fc499ab63392a59ebab358f714b2b91d912ed72a711db7955c189628ebb3c7af/68747470733a2f2f706f7365722e707567782e6f72672f6f766572747275652f666c7973797374656d2d636f732f646f776e6c6f616473)](https://packagist.org/packages/overtrue/flysystem-cos) [![License](https://camo.githubusercontent.com/27df82cff44d4353aebab097cf0be0d3da31b136c932be4039b1ddfdf1611bd2/68747470733a2f2f706f7365722e707567782e6f72672f6f766572747275652f666c7973797374656d2d636f732f6c6963656e7365)](https://packagist.org/packages/overtrue/flysystem-cos)

[![Sponsor me](https://github.com/overtrue/overtrue/raw/master/sponsor-me-button-s.svg?raw=true)](https://github.com/sponsors/overtrue)

Requirement
-----------

[](#requirement)

- PHP &gt;= 8.0.2

Installation
------------

[](#installation)

```
composer require overtrue/flysystem-cos -vvv
```

Usage
-----

[](#usage)

```
use League\Flysystem\Filesystem;
use Overtrue\Flysystem\Cos\CosAdapter;

$config = [
    // 必填，app_id、secret_id、secret_key
    // 可在个人秘钥管理页查看：https://console.cloud.tencent.com/capi
    'app_id' => 10020201024,
    'secret_id' => 'AKIDsiQzQla780mQxLLU2GJCxxxxxxxxxxx',
    'secret_key' => 'b0GMH2c2NXWKxPhy77xhHgwxxxxxxxxxxx',

    'region' => 'ap-guangzhou',
    'bucket' => 'example',

    // 可选，如果 bucket 为私有访问请打开此项
    'signed_url' => false,

    // 可选，是否使用 https，默认 false
    'use_https' => true,

    // 可选，自定义域名
    'domain' => 'emample-12340000.cos.test.com',

    // 可选，使用 CDN 域名时指定生成的 URL host
    'cdn' => 'https://youcdn.domain.com/',
];

$adapter = new CosAdapter($config);

$flysystem = new League\Flysystem\Filesystem($adapter);
```

API
---

[](#api)

```
bool $flysystem->write('file.md', 'contents');

bool $flysystem->write('file.md', 'http://httpbin.org/robots.txt', ['mime' => 'application/redirect302']);

bool $flysystem->writeStream('file.md', fopen('path/to/your/local/file.jpg', 'r'));

bool $flysystem->move('foo.md', 'bar.md');

bool $flysystem->copy('foo.md', 'foo2.md');

bool $flysystem->delete('file.md');

bool $flysystem->fileExists('file.md');

string|mixed|false $flysystem->read('file.md');

array $flysystem->listContents();

int $flysystem->fileSize('file.md');

string $flysystem->mimeType('file.md');

int $flysystem->lastModified('file.md');
```

❤️ Sponsor me
-------------

[](#heart-sponsor-me)

[![Sponsor me](https://github.com/overtrue/overtrue/raw/master/sponsor-me.svg?raw=true)](https://github.com/sponsors/overtrue)

如果你喜欢我的项目并想支持它，[点击这里 ❤️](https://github.com/sponsors/overtrue)

Project supported by JetBrains
------------------------------

[](#project-supported-by-jetbrains)

Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.

[![](https://camo.githubusercontent.com/3cf726e7cdadba47755b7f7ea4227945a92a2fa48aadf4a2573140ec6501c989/68747470733a2f2f7265736f75726365732e6a6574627261696e732e636f6d2f73746f726167652f70726f64756374732f636f6d70616e792f6272616e642f6c6f676f732f6a625f6265616d2e737667)](https://www.jetbrains.com/?from=https://github.com/overtrue)

License
-------

[](#license)

MIT

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance65

Regular maintenance activity

Popularity52

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 82.4% 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 ~79 days

Recently: every ~128 days

Total

31

Last Release

236d ago

Major Versions

1.0.1 → 2.0.02019-10-08

2.x-dev → 3.0.02020-10-30

3.x-dev → 4.0.02021-07-07

4.0.1 → 5.0.02022-02-14

PHP version history (3 changes)1.0.0PHP &gt;=7.0

3.0.0PHP &gt;=7.4

5.0.2PHP &gt;=8.0.2

### Community

Maintainers

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

---

Top Contributors

[![overtrue](https://avatars.githubusercontent.com/u/1472352?v=4)](https://github.com/overtrue "overtrue (75 commits)")[![sy-records](https://avatars.githubusercontent.com/u/33931153?v=4)](https://github.com/sy-records "sy-records (4 commits)")[![DoveChen](https://avatars.githubusercontent.com/u/12093494?v=4)](https://github.com/DoveChen "DoveChen (2 commits)")[![lddtime](https://avatars.githubusercontent.com/u/19882218?v=4)](https://github.com/lddtime "lddtime (2 commits)")[![limingxinleo](https://avatars.githubusercontent.com/u/16648551?v=4)](https://github.com/limingxinleo "limingxinleo (2 commits)")[![ramzeng](https://avatars.githubusercontent.com/u/38133602?v=4)](https://github.com/ramzeng "ramzeng (2 commits)")[![Jesse176](https://avatars.githubusercontent.com/u/140039477?v=4)](https://github.com/Jesse176 "Jesse176 (1 commits)")[![russellxrs](https://avatars.githubusercontent.com/u/39029427?v=4)](https://github.com/russellxrs "russellxrs (1 commits)")[![summerblue](https://avatars.githubusercontent.com/u/324764?v=4)](https://github.com/summerblue "summerblue (1 commits)")[![hepeichun](https://avatars.githubusercontent.com/u/13855247?v=4)](https://github.com/hepeichun "hepeichun (1 commits)")

---

Tags

flysystemflysystem-adapterqcloudqcloud-cos

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/overtrue-flysystem-cos/health.svg)

```
[![Health](https://phpackages.com/badges/overtrue-flysystem-cos/health.svg)](https://phpackages.com/packages/overtrue-flysystem-cos)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[league/flysystem-local

Local filesystem adapter for Flysystem.

225231.8M39](/packages/league-flysystem-local)[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40129.5M87](/packages/league-flysystem-bundle)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[league/flysystem-memory

In-memory filesystem adapter for Flysystem.

8533.6M194](/packages/league-flysystem-memory)

PHPackages © 2026

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