#!/usr/bin/env php
<?php 
require_once 'authtoken.php';
$QBOX_ACCESS_KEY = '<Please apply your access key>';
$QBOX_SECRET_KEY = '<Dont send your secret key to anyone>';
$opts = array("scope" => "test_bucket", "expiresIn" => 3600, "callbackUrl" => "http://example.com/callback?a=b&d=c");
$upToken = \QBox\MakeAuthToken($opts);
var_dump($upToken);
Exemple #2
0
    echo "Buckets failed: {$code} - {$msg}\n";
}
$key = '000-default';
$friendName = 'rs_demo.php';
$key2 = '000-default2';
$friendName2 = 'rs_demo2.php';
list($result, $code, $error) = $rs->PutFile2($key, '', __FILE__);
echo time() . " ===> PutFile result:\n";
if ($code == 200) {
    var_dump($result);
} else {
    $msg = QBox\ErrorMessage($code, $error);
    echo "PutFile failed: {$code} - {$msg}\n";
    exit(-1);
}
$upToken = QBox\MakeAuthToken(array('expiresIn' => 3600));
echo time() . " ===> Uptoken: {$upToken}\n";
list($result, $code, $error) = QBox\RS\UploadFile($upToken, $bucket, $key, '', __FILE__, 'CustomData', array('key' => $key));
echo time() . " ===> PutFile {$key} result:\n";
if ($code == 200) {
    var_dump($result);
} else {
    $msg = QBox\ErrorMessage($code, $error);
    echo "PutFile failed: {$code} - {$msg}\n";
    exit(-1);
}
list($result, $code, $error) = QBox\RS\UploadFile($upToken, $bucket, $key2, '', __FILE__, 'CustomData', array('key' => $key2));
echo time() . " ===> PutFile {$key2} result:\n";
if ($code == 200) {
    var_dump($result);
} else {