Home > Backend Development > PHP Tutorial > 在七牛回调的中,是否有返回文件大小属性。属性是什么

在七牛回调的中,是否有返回文件大小属性。属性是什么

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:28:50
Original
1399 people have browsed it

<code>请输入代码</code>
Copy after login
Copy after login

回复内容:

<code>请输入代码</code>
Copy after login
Copy after login

上传策略的callbackBody字段设置fsize这个魔法变量即可:

http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#magicvar

php的话就是生成token的地方

<code> $bucket = Config::BUCKET_NAME;
    $accessKey = Config::ACCESS_KEY;
    $secretKey = Config::SECRET_KEY;
    $auth = new Auth($accessKey, $secretKey);

    $policy = array(
      'callbackUrl' => 'http://172.30.251.210/callback.php',
      'callbackBody' => '{"fname":"$(fname)", "fsize":"$(fsize)", "fkey":"$(key)", "desc":"$(x:desc)", "uid":' . $uid . '}'
      );

    $upToken = $auth->uploadToken($bucket, null, 3600, $policy);

    header('Access-Control-Allow-Origin:*');
    echo $upToken;</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template