欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

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

程序员文章站 2024-01-17 11:24:10
...
上传媒体图片的时候,出现了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))
        );