upload_mgr_init.php 431B

12345678910111213141516171819
  1. <?php
  2. require_once __DIR__ . '/../autoload.php';
  3. use Qiniu\Auth;
  4. use Qiniu\Storage\UploadManager;
  5. $accessKey = 'Access_Key';
  6. $secretKey = 'Secret_Key';
  7. $auth = new Auth($accessKey, $secretKey);
  8. // 空间名 http://developer.qiniu.com/docs/v6/api/overview/concepts.html#bucket
  9. $bucket = 'Bucket_Name';
  10. // 生成上传Token
  11. $token = $auth->uploadToken($bucket);
  12. // 构建 UploadManager 对象
  13. $uploadMgr = new UploadManager();