正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
@@ -218,8 +218,8 @@ class SalesmangoodsController extends WeChatBaseController{ | @@ -218,8 +218,8 @@ class SalesmangoodsController extends WeChatBaseController{ | ||
218 | $access_token=$this->getAccessToken(); | 218 | $access_token=$this->getAccessToken(); |
219 | $filepath = $_POST['mediaId'];//文件的绝对路径 | 219 | $filepath = $_POST['mediaId'];//文件的绝对路径 |
220 | $str = date('YmdHis').random(12).'.jpg'; | 220 | $str = date('YmdHis').random(12).'.jpg'; |
221 | - $targetName = '/uploads/'.date(Ymd).'/'.$str; | ||
222 | - $ch = curl_int("https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=".$access_token."&media_id=".$filepath); | 221 | + $targetName = '/uploads/'.date('Ymd').'/'.$str; |
222 | + $ch = curl_int("https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=$access_token&media_id=$filepath"); | ||
223 | $fp = fopen($targetName, 'wb'); | 223 | $fp = fopen($targetName, 'wb'); |
224 | curl_setopt($ch, CURLOPT_FILE, $fp); | 224 | curl_setopt($ch, CURLOPT_FILE, $fp); |
225 | curl_setopt($ch, CURLOPT_HEADER, 0); | 225 | curl_setopt($ch, CURLOPT_HEADER, 0); |
-
请 注册 或 登录 后发表评论