PHP code example of xiaoheiba / qiniu
1. Go to this page and download the library: Download xiaoheiba/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/ */
xiaoheiba / qiniu example snippets
use Qiniu\Storage\UploadManager;
use Qiniu\Auth;
...
$uploadMgr = new UploadManager();
$auth = new Auth($accessKey, $secretKey);
$token = $auth->uploadToken($bucket);
list($ret, $error) = $uploadMgr->putFile($token, 'key', 'filePath');
...