PHP code example of jsuphp / jdcloud-oss

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

    

jsuphp / jdcloud-oss example snippets


//傻瓜方式

use jsuphp\jdcloudOss\Sdk;


$config = [
    'endpoint'       =>  's3.cn-south-1.jdcloud-oss.com',
    'bucket'         =>  '',
    'access_key_id'  =>  '',
    'access_key_secret'  =>  '',
    'domain'         =>  '自定义静态域名',
    'region'         =>  'cn-south-1',
];
$jd = new \jsuphp\jdcloudOss\Sdk($config);

$result = $jd->upload('1.jpg','1.jpg');
echo '<pre>';
print_r($result);exit;

$result = $jd->delete('222.jpg');
print_r($result);exit;