//composer require qiniu/php-sdk 下载sdk
public function index()
{
require_once 'vendor/qiniu/php-sdk/autoload.php';
$accessKey = C('ACCESSKEY');
$secretKey = C('SECRETKEY');
// 构建鉴权对象
classLoader('Auth');
$auth = new Auth($accessKey,$secretKey);
// 要上传的空间
$bucket = C('BUCKET');
$token = $auth->uploadToken($bucket);
$this->assign('token',$token);
$this->display();
}
<script src="__PUBLIC__/jquery-2.0.3.min.js"></script>
解决没有文件名
// do something with key here
return key
}
}
});
</script>
https://files.cnblogs.com/files/JANCHAN/plupload.full.min.js
https://files.cnblogs.com/files/JANCHAN/qiniu.min.js