tp3.2 php sdk上传七牛云

//获取上传token
Vendor('sdk.autoload');
$accessKey='********';
$secretKey='*******';
$auth=new QiniuAuth($accessKey,$secretKey);
$token=$auth->uploadToken('***');
//此路径为绝对路径
$filePath =$path;
// 上传到七牛后保存的文件名
$key = 'ceshi.txt';
$uploadMgr = new QiniuStorageUploadManager();
list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath);
if ($err !== null) {
$res['content']=$err;
$res['error'] = 201;
} 
else 
{
 //进行入库
 $res['content']='成功';
 $res['error']= 200;
}
原文地址:https://www.cnblogs.com/phpwyl/p/8780921.html