欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

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

程序员文章站 2022-06-10 11:18:40
...
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;

回复内容:

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;

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

相关标签: php 七牛云存储