apollopy/flysystem-aliyun-oss

This is a Flysystem adapter for the Aliyun OSS ~2.3

Maintainers

👁 apollopy

Package info

github.com/apollopy/flysystem-aliyun-oss

pkg:composer/apollopy/flysystem-aliyun-oss

Statistics

Installs: 128 002

Dependents: 4

Suggesters: 1

Stars: 91

Open Issues: 2

1.2.1 2020-01-19 08:30 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT dda79e1bf69500a68c0a6f55d0644487ee26c0e0

  • ApolloPY <ApolloPY.woop@Gmail.com>

This package is auto-updated.

Last update: 2026-06-06 12:26:23 UTC


README

This is a Flysystem adapter for the Aliyun OSS ~2.3

inspire by aobozhang/aliyun-oss-adapter

Installation

composer require apollopy/flysystem-aliyun-oss

for Laravel

This service provider must be registered.

// config/app.php

'providers' => [
 '...',
 ApolloPY\Flysystem\AliyunOss\AliyunOssServiceProvider::class,
];

edit the config file: config/filesystems.php

add config

'oss' => [
 'driver' => 'oss',
 'access_id' => env('OSS_ACCESS_ID','your id'),
 'access_key' => env('OSS_ACCESS_KEY','your key'),
 'bucket' => env('OSS_BUCKET','your bucket'),
 'endpoint' => env('OSS_ENDPOINT','your endpoint'),
 'prefix' => env('OSS_PREFIX', ''), // optional
],

change default to oss

 'default' => 'oss'

Use

see Laravel wiki

Plugins

inspire by itbdw/laravel-storage-qiniu

Storage::disk('oss')->putFile($md5_path, '/local_file_path/1.png', ['mimetype' => 'image/png','filename' => 'filename_by_down.png']);

Storage::disk('oss')->signedDownloadUrl($path, 3600, 'oss-cn-beijing.aliyuncs.com', true);

IDE Helper

if installed barryvdh/laravel-ide-helper

edit the config file: config/ide-helper.php

'interfaces' => [
 '\Illuminate\Contracts\Filesystem\Filesystem' => ApolloPY\Flysystem\AliyunOss\FilesystemAdapter::class,
],