PHP code example of jmjl161100 / laravel-chunk-upload

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

    

jmjl161100 / laravel-chunk-upload example snippets




return [
   'disks' => [
        //...
        'qiniu' => [
           'driver'     => 'qiniu',
           'access_key' => env('QINIU_ACCESS_KEY', 'xxxxxxxxxxxxxxxx'),
           'secret_key' => env('QINIU_SECRET_KEY', 'xxxxxxxxxxxxxxxx'),
           'bucket'     => env('QINIU_BUCKET', 'test'),
           'domain'     => env('QINIU_DOMAIN', 'xxx.clouddn.com'), // or host: https://xxxx.clouddn.com
        ],
        //...
    ]
];

use Jmjl161100\ChunkUpload\Facades\CheckUpload;

// initialization
$rt = CheckUpload::init($fileName);

// Upload data in chunks
$rt = CheckUpload::uploadPart($uploadId, $partNumber, $file);

// Complete file upload
$rt = CheckUpload::complete($uploadId, $partList);