...
|
...
|
@@ -229,15 +229,15 @@ class SalesmangoodsController extends WeChatBaseController{ |
|
|
$filepath = $_POST['mediaId'];//文件的绝对路径
|
|
|
$str = date('YmdHis').mt_rand('100','999').'.jpg';
|
|
|
$targetName = '/uploads/'.$str;
|
|
|
cache('msgssss',$targetName);
|
|
|
|
|
|
$ch = curl_init("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath");
|
|
|
cache('a1',1111);
|
|
|
$fp = fopen($targetName, 'w');
|
|
|
cache('a100',2222);
|
|
|
|
|
|
$fp = fopen($targetName, 'wb');
|
|
|
|
|
|
curl_setopt($ch, CURLOPT_FILE, $fp);
|
|
|
cache('a200',3333);
|
|
|
|
|
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
cache('a300',4444);
|
|
|
|
|
|
$msg["status"] = curl_exec($ch);
|
|
|
$msg["filename"] = $str;
|
|
|
curl_close($ch);
|
...
|
...
|
|