PHP code example of hlf_513 / ufile-storage

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

    

hlf_513 / ufile-storage example snippets


    'disks' => [
        'ufile' => [
            'driver'  => 'ucloud-ufile',
            'bucket' => env('UFILE_BUCKET'),
            'suffix' => env('UFILE_SUFFIX'),  //.ufile.ucloud.cn
            'public_key'=> env('UFILE_ACCESS_KEY'),  //AccessKey
            'secret_key'=> env('UFILE_SECRET_KEY'),  //SecretKey
        ]
    ],

$file = Storage::disk('public')->get('file.txt');
Storage::disk('ufile')->put('file.name', $file);