PHP code example of ennnnny / owladmin-cloud-storage

1. Go to this page and download the library: Download ennnnny/owladmin-cloud-storage 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/ */

    

ennnnny / owladmin-cloud-storage example snippets


use Ennnnny\CloudStorage\Traits\UploadPickerTrait;
class CloudResourceController extends BaseController
{
    use UploadPickerTrait;
    
    // 调用方法
    $this->uploadPicker('icon', __('admin.admin_menu.icon'));
}

use Ennnnny\CloudStorage\Traits\UploadTrait;

//获取文件下载链接
$this->cloudGetUrl($resource_id, $openDomain = '');

//简单上传
$this->cloudSimpleUpload($file_path, $storage_id, $fileName = '');

//分片上传
$this->cloudChunkUpload($file_path, $storage_id, $fileName = '', $chunk_size = 50 * 1024 * 1024, $min_size = 5 * 1024 * 1024 * 1024);