20 lines
477 B
PHP
Raw Normal View History

2023-05-10 13:39:12 +08:00
<?php
require_once __DIR__ . '/../autoload.php';
2024-02-28 16:51:38 +08:00
use \Qiniu\Auth;
2023-05-10 13:39:12 +08:00
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
2023-11-02 14:13:04 +08:00
$key = "qiniu.mp4";
2024-02-28 16:51:38 +08:00
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
list($fileInfo, $err) = $bucketManager->stat($bucket, $key);
if ($err) {
print_r($err);
2023-05-10 13:39:12 +08:00
} else {
2024-02-28 16:51:38 +08:00
print_r($fileInfo);
2023-05-10 13:39:12 +08:00
}