PHP code example of printfshen / yii2-aliyun-oss

1. Go to this page and download the library: Download printfshen/yii2-aliyun-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/ */

    

printfshen / yii2-aliyun-oss example snippets


    'oss' => [
        'accessKeyId' => 'accessKeyId',
        'accessKeySecret' => 'accessKeySecret',
        'bucket' => 'bucket',
        'endPoint' => 'endPoint', 
    ],

 初始化 $oss = Oss::getInstance();
 上传   $oss->uploadFile($fileName, $filePath);
 删除   $oss->deleteFile($path);
 查看是否存在 $oss->doesFileExist($path);