PHPackages                             mocode/flysystem-aliyunoss - 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. mocode/flysystem-aliyunoss

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

mocode/flysystem-aliyunoss
==========================

Flysystem adapter for the Aliyun Oss storage.

1.0.0(7y ago)12.4kMITPHPPHP &gt;=5.5.9

Since Apr 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mooole/flysystem-aliyunoss)[ Packagist](https://packagist.org/packages/mocode/flysystem-aliyunoss)[ RSS](/packages/mocode-flysystem-aliyunoss/feed)WikiDiscussions master Synced 3w ago

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

 flysystem-aliyunoss
=====================

[](#-flysystem-aliyunoss-)

 This is a Flysystem adapter for the Aliyun OSS ~2.3

Inspired By
===========

[](#inspired-by)

- [overtrue/flysystem-qiniu](https://github.com/overtrue/flysystem-qiniu)
- [apollopy/flysystem-aliyun-oss](https://github.com/apollopy/flysystem-aliyun-oss)

Installation
============

[](#installation)

```
$ composer require mocode/flysystem-aliyunoss
```

Usage
=====

[](#usage)

```
use League\Flysystem\Filesystem;
use Mocode\Flysystem\AliyunOss\AliyunOssAdapter;
use OSS\OssClient;

$accessId = 'Aliyun Oss Access Id';
$accessKey = 'Aliyun Oss Access Key';
$endPoint = 'Aliyun Oss endPoint';
$bucket = 'Aliyun Oss Bucket';
$domain = 'Aliyun Oss CDN Domain';

$client = new OssClient($accessId, $accessKey, $endPoint);
$adapter = new AliyunOssAdapter($client, $bucket, $domain);

$flysystem = new Filesystem($adapter);
```

API
---

[](#api)

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

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

bool $flysystem->update('file.md', 'new contents');

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

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

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

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

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

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

array $flysystem->listContents();

array $flysystem->getMetadata('file.md');

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

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

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

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

[Full API documentation.](http://flysystem.thephpleague.com/api/)

### Plugins

[](#plugins)

File Url:

```
use Mocode\Flysystem\AliyunOss\\Plugins\PutFile;

$flysystem->addPlugin(new PutFile());

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

for Laravel
===========

[](#for-laravel)

edit .env

> add aliyun oss config

```
OSS_ACCESS_ID=xxxxxxxxxxxx
OSS_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxx
OSS_BUCKET=xxxxxxxxxx
OSS_ENDPOINT=xxxxxxxxx
OSS_DOMAIN=xxxxxxxxxxxx

```

edit the config file: config/filesystems.php

> add config

```
'oss' => [
    'driver'     => 'oss',
    'access_id'  => env('OSS_ACCESS_ID'), // Aliyun OSS AccessKeyId
    'access_key' => env('OSS_ACCESS_KEY'), // Aliyun OSS AccessKeySecret
    'bucket'     => env('OSS_BUCKET'), // OSS bucket name
    'endpoint'   => env('OSS_ENDPOINT'), // OSS 节点或自定义外部域名
    'domain'     => env('OSS_DOMAIN'), // CDN domain
],
```

> change default to oss

```
'default' => 'oss'
```

### use

[](#use)

see [Laravel wiki](https://laravel.com/docs/5.8/filesystem)

License
=======

[](#license)

MIT

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

2615d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47845306?v=4)[Moritz Wright](/maintainers/mocode)[@MoCode](https://github.com/MoCode)

---

Top Contributors

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

---

Tags

aliyun-oss-phpfilesystemfilesystem-adapterlaravel-filesystemlaravel-package

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mocode-flysystem-aliyunoss/health.svg)

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

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k277.8M961](/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.1k3.4M81](/packages/unisharp-laravel-filemanager)[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40131.4M119](/packages/league-flysystem-bundle)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[alexusmai/laravel-file-manager

File manager for Laravel

1.2k786.7k9](/packages/alexusmai-laravel-file-manager)[iidestiny/flysystem-oss

Flysystem adapter for the Oss storage.

95628.8k29](/packages/iidestiny-flysystem-oss)

PHPackages © 2026

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