PHP code example of de-memory / alioss-upload

1. Go to this page and download the library: Download de-memory/alioss-upload 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/ */

    

de-memory / alioss-upload example snippets


'extensions' => [
        'alioss-upload' => [
            'OSS_ACCESS_ID' => '*****',
            'OSS_ACCESS_KEY' => '**************',
            'OSS_ENDPOINT' => 'oss-cn-shanghai.aliyuncs.com',
            'OSS_BUCKET' => '*****',
            'OSS_HOST' => 'http://****.oss-cn-shanghai.aliyuncs.com',
            'OSS_URL' => 'http://***.oss-cn-shanghai.aliyuncs.com' // 自定义域名(CDN)
        ]
    ],

$form->aliOss('pic', '图片')->attribute('file');  // 单图(默认)
$form->aliOss('pic2', '图片2')->attribute('images'); // 多图

composer san vendor:publish --provider=Encore\AliOssUpload\AliOssUploadServiceProvider