PHP code example of gaodewen / oss-sdk

1. Go to this page and download the library: Download gaodewen/oss-sdk 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/ */

    

gaodewen / oss-sdk example snippets


composer 

use gaodewen\OssSdk\Factory\CloudFactory;
  //接收文件上传的值
        $file = $_FILES;
        $type=$request->post('type');//上传的类型
        $config=[
            'ak'=>'',
            'sk'=>'',
            'region'=>'',//地区
            'bucket'=>'', //桶名
            'url'=>'' //加速域名
        ];
        $obj=new CloudFactory();
        $res=$obj->uploadCloud($type)->cloud($file,$config);
        if ($res){
            return $res;
        }