首页 >后端开发 >php教程 >微信上传图片,couldn't open file

微信上传图片,couldn't open file

WBOY
WBOY原创
2016-06-06 20:06:283882浏览

上传媒体图片的时候,出现了couldn't open file

<code>$path = "D:/wamp/www/weixin/images/A5Le5Zmn1j1j1899Jenw7D7Ec75ZW7.jpg";

$url = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token={$token}&type={$type}";

$data = array(
            'media' => new CURLFile(ltrim($path))
        );

</code>

回复内容:

上传媒体图片的时候,出现了couldn't open file

<code>$path = "D:/wamp/www/weixin/images/A5Le5Zmn1j1j1899Jenw7D7Ec75ZW7.jpg";

$url = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token={$token}&type={$type}";

$data = array(
            'media' => new CURLFile(ltrim($path))
        );

</code>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn