検索

ホームページ  >  に質問  >  本文

php - uploadToken里的四个参数分别是什么意思?

<?php
require_once  'vendor/autoload.php';
header('Access-Control-Allow-Origin:*');

use Qiniu\Auth;

$bucket = 'devtest';
$accessKey = 'Access_Key';
$secretKey = 'Secret_Key';
$auth = new Auth($accessKey, $secretKey);


//$upToken = $auth->uploadToken($bucket);

$policy = array(
    'returnUrl' => 'http://127.0.0.1/demo/simpleuploader/fileinfo.php',
    'returnBody' => '{"fname": $(fname)}',
);
$upToken = $auth->uploadToken($bucket, null, 3600, $policy);

echo $upToken;
ringa_leeringa_lee2777日前700

全員に返信(1)返信します

  • 巴扎黑

    巴扎黑2017-04-10 16:35:45

    uploadToken($bucket, null, 3600, $policy);
    顺序依次是 空间,文件名,有效时长deadline,上传策略;
    参考文档
    http://developer.qiniu.com/docs/v6/api/reference/security/upload-token.html
    http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html

    返事
    0
  • キャンセル返事