PHP code example of baicaiit / admin-oss

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

    

baicaiit / admin-oss example snippets


    return [
        "access_id" => env('OSS_ACCESSKEYID', ''),
        "access_key" => env('OSS_ACCESSKEYSECRET', ''),
        "bucket" => env('OSS_BUCKET', ''),
        "endpoint" => env('OSS_ENDPOINT', ''),
        "ssl" => env('OSS_SSL', false),
    ];

//一般用法
$form->customFile('test', '测试'); //单文件上传
$form->customMultiFile('test', '测试'); //多文件上传
$form->customEditor('test', '测试'); //富文本

//设置参数
$form->customFile('test', '测试')->maxFileSize('10kb')->fileExtensions('rar,mp4,jpg'); //设置上传文件大小和设置文件后缀