} else { $aq = '1'; $videologo = '../../web/resource/images/gw-logo.png'; $videofbl = '640x480'; $wmgravity = 'NorthEast'; } Qiniu_SetKeys($accessKey, $secretKey); $client = new Qiniu_MacHttpClient(null); /**if($upmediatmp){ $putPolicy = new Qiniu_RS_PutPolicy($bucket); $upToken = $putPolicy->Token(null); $putExtra = new Qiniu_PutExtra(); $putExtra->Crc32 = 1; list($ret, $err) = Qiniu_PutFile($upToken, $key1, $upmediatmp, $putExtra); }else {**/ list($ret, $err) = Qiniu_RS_Fetch($client, $upmediatmp, $bucket, $key1); //} if ($err !== null) { // var_dump($err); $fmdata = array("success" => -1, "msg" => $err); //echo json_encode($fmdata); //exit(); echo json_encode($fmdata); exit; } else { $pfop = new Qiniu_Pfop(); $pfop->Bucket = $bucket; $pfop->Key = $nfilename; if ($audiotype == 'music') { $nfilenamefop = 'FMFOPM' . date('YmdHis') . random(16) . '.mp3'; $savedKey = $nfilenamefop;
/** * Copy a file by url * * @param $url * @param $path * @return bool * @internal param $newpath */ public function urlCopy($url, $path) { $err = Qiniu_RS_Fetch($this->getClient(), $url, $this->bucket, $path); return $err === null; }