PHP code example of bleeld / driver-qiniu

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

    

bleeld / driver-qiniu example snippets


use QiniuOSS\Storage\UploadManager;
use QiniuOSS\Auth;
...
    $uploadMgr = new UploadManager();
    $auth = new Auth($accessKey, $secretKey);
    $token = $auth->uploadToken($bucket);
    list($ret, $error) = $uploadMgr->putFile($token, 'key', 'filePath');
...