PHP code example of imnpc / laravel-flysystem-oss

1. Go to this page and download the library: Download imnpc/laravel-flysystem-oss library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

imnpc / laravel-flysystem-oss example snippets


    'oss' => [
        'driver' => 'oss',
        'access_id' => env('OSS_ACCESS_KEY_ID'),
        'access_key' => env('OSS_ACCESS_KEY_SECRET'),
        'bucket' => env('OSS_BUCKET'),
        'endpoint' => env('OSS_ENDPOINT'), // 不要用CName,经过测试,官方SDK实现不靠谱
        'url' => env('OSS_DOMAIN'), // CNAME 写这里,可以是域名绑定或者CDN地址 如 https://www.bbb.com 末尾不要斜杠
        'root' => env('OSS_ROOT', ''), // 这个文件路径前缀,如果上传的内容全部在子目录就填写,否则为空
        'security_token' => null,
        'proxy' => null,
        'timeout' => 3600,
        'ssl' => env('OSS_SSL', false),
    ],



# 阿里云 OSS
OSS_ACCESS_KEY_ID=
OSS_ACCESS_KEY_SECRET=
OSS_BUCKET=
OSS_ENDPOINT=
OSS_DOMAIN=
OSS_ROOT=
OSS_SSL=


    'default' => 'oss'