Created
September 18, 2014 07:59
-
-
Save ikbear/2dfe89128c13a6636feb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once("../../qiniu/http.php"); | |
require_once("../../qiniu/auth_digest.php"); | |
require_once("../../qiniu/utils.php"); | |
$accessKey = "aW6EvpZBvWr5Qq3HiFCLiCmvkJORHN8oE-vKR8-z"; | |
$secretKey = "8T270kMZuVZHRjLt6ACKdXj3VAAwPbmeOykQdmOA"; | |
$bucket = "kouqiangzhongzhi"; | |
$key = "CAD CAM种植导板的临床应用(1).mp4"; | |
// $fops = "avthumb/flash/vb/2000k"; | |
$fops = "avthumb/m3u8/preset/video_640k"; | |
$notifyURL = "http://s52nxfcib7t9.runscope.net/"; | |
$pipeline = "pekin"; | |
$force = 0; | |
$encodedBucket = urlencode($bucket); | |
$encodedKey = urlencode($key); | |
$encodedFops = urlencode($fops); | |
$encodedNotifyURL = urlencode($notifyURL); | |
$encodedPipeline = urlencode($pipeline); | |
$apiHost = "http://api.qiniu.com"; | |
$apiPath = "/pfop/"; | |
$requestBody = "bucket=$encodedBucket&key=$encodedKey&fops=$encodedFops¬ifyURL=$encodedNotifyURL&pipeline=$encodedPipeline"; | |
// echo "Body 1: " . $requestBody . "\n"; | |
// $requestBody = "bucket=helishi&key=math.mp4&fops=avthumb/m3u8/preset/video_640k/hlsKey/ZXhhbXBsZWtleTEyMzQ1Ng==/hlsKeyUrl/aHR0cDovL3p0ZXN0LnFpbml1ZG4uY29tL2NyeXB0MC5rZXk=¬ifyURL=http://kaikeba-test.qiniudn.com&pipeline=ikbear"; | |
echo "Body : " . $requestBody . "\n"; | |
if ($force !== 0) { | |
$requestBody .= "&force=1"; | |
} | |
$mac = new Qiniu_Mac($accessKey, $secretKey); | |
$client = new Qiniu_MacHttpClient($mac); | |
list($ret, $err) = Qiniu_Client_CallWithForm($client, $apiHost . $apiPath, $requestBody); | |
if ($err !== null) { | |
echo "failed\n"; | |
var_dump($err); | |
} else { | |
echo "success\n"; | |
var_dump($ret); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment