- <image src="以斜杠结尾">的bug?
[图片] 发现一个bug,image写错了图片路径,不小心以/斜杠结尾了,但是微信开发者工具图片能正常显示,没能及时发现该bug,导致微信小程序里图片不显示。
01-15 - php7.4 上传临时素材无法成功
php7.4使用curl上传临时素材,API返回空白(The requested URL returned error: 412 Precondition Failed),http状态码412 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html 同样的反馈帖子: https://developers.weixin.qq.com/community/develop/doc/000a6ca7ae4988a4d9f949d4456800 https://developers.weixin.qq.com/community/develop/doc/0004089f8d078823aef9b63655b400 <?php # 下面是我的测试代码: $url = 'https://api.weixin.qq.com/cgi-bin/media/upload?access_token=...&type=image'; $data = [ 'media' => new CURLFile('F:\web\30101441194a79ab.jpg') ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $res= curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); echo '<pre>'; var_dump($res); var_dump($info); echo '</pre>'; ?>
2020-10-27