cdn_timestamp_antileech.php 506B

1234567891011121314151617181920
  1. <?php
  2. require_once __DIR__ . '/../autoload.php';
  3. use \Qiniu\Cdn\CdnManager;
  4. //创建时间戳防盗链
  5. //时间戳防盗链密钥,后台获取
  6. $encryptKey = 'your_domain_timestamp_antileech_encryptkey';
  7. //带访问协议的域名
  8. $url1 = 'http://phpsdk.qiniuts.com/24.jpg?avinfo';
  9. $url2 = 'http://phpsdk.qiniuts.com/24.jpg';
  10. //有效期时间(单位秒)
  11. $durationInSeconds = 3600;
  12. $signedUrl = CdnManager::createTimestampAntiLeechUrl($url1, $encryptKey, $durationInSeconds);
  13. print($signedUrl);