关于调用 imgSecCheck 接口,不管上传什么图片为什么均返回 ok?
发布于 4 年前 作者 fuli 9225 次浏览 来自 官方Issues

//$img-----上传的图片;

$imgs = file_get_contents($img);

$filePath = $_SERVER[‘DOCUMENT_ROOT’].’/upload/images/dev/test.jpg’;

file_put_contents($filePath, $imgs);

$file = [‘media’ => curl_file_create(realpath($filePath),‘image/jpeg’,‘test’)];

$url  = ‘https://api.weixin.qq.com/wxa/img_sec_check?access_token=’.$token;

$header =‘formdata’;

$imgSecCheck_res = $this->request_post($url,$file,$header);

function request_post($url,$postdata,$header) {…} —————— $header = array(‘Content-Type:multipart/form-data’)

请问大神以上代码有什么问题?

不管上传什么图片都会返回 “{“errcode”:0,“errmsg”:“ok”}”

1 回复

谢邀,这返回看起来调用是正常的 可以试试用政治人物图片看看

回到顶部