Home >Backend Development >PHP Tutorial >微信上传图片,couldn't open file

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

WBOY
WBOYOriginal
2016-06-06 20:06:283881browse

上传媒体图片的时候,出现了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>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn