您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

微信开发,使用下头方法保存文件是无法保存

2025/6/23 9:38:14发布28次查看
微信开发,使用下面方法保存文件是无法保存
使用下面方法 文件已生成,无法保存文件,菜鸟一只,希望帮忙解答下。
function savepic($serverid,$picname){
$accesstoken = $this->getaccesstoken();
$targetname = './upload/'.$picname.'.jpg';
$ch = curl_init(http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$accesstoken&media_id=$serverid);
$fp = fopen($targetname, 'wb');
curl_setopt($ch, curlopt_file, $fp);
curl_setopt($ch, curlopt_header, 0);
curl_setopt($ch, curlopt_returntransfer, true);
curl_exec($ch);
curl_close($ch);
fclose($fp);
}
------解决思路----------------------
你这样看看
curl_setopt($ch, curlopt_file, $fp);
curl_setopt($ch, curlopt_header, 0);
//curl_setopt($ch, curlopt_returntransfer, true);
curl_exec($ch);
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product