当前位置:Gxlcms > PHP教程 > 微信上传图片,couldn'topenfile

微信上传图片,couldn'topenfile

时间:2021-07-01 10:21:17 帮助过:46人阅读

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

$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))
        );

回复内容:

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

$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))
        );

人气教程排行