作者 anyv
1 个管道 的构建 通过 耗费 0 秒

4

@@ -224,7 +224,7 @@ class SalesmangoodsController extends WeChatBaseController{ @@ -224,7 +224,7 @@ class SalesmangoodsController extends WeChatBaseController{
224 $access_token=$this->getAccessToken(); 224 $access_token=$this->getAccessToken();
225 $filepath = $_POST['mediaId'];//文件的绝对路径 225 $filepath = $_POST['mediaId'];//文件的绝对路径
226 $str = date('YmdHis').mt_rand('100','999').'.jpg'; 226 $str = date('YmdHis').mt_rand('100','999').'.jpg';
227 - $targetName = '/uploads/'.date('Ymd').'/'.$str; 227 + $targetName = '/uploads/'.$str;
228 $ch = curl_init("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath"); 228 $ch = curl_init("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath");
229 $fp = fopen($targetName, 'wb'); 229 $fp = fopen($targetName, 'wb');
230 curl_setopt($ch, CURLOPT_FILE, $fp); 230 curl_setopt($ch, CURLOPT_FILE, $fp);