- 求助,有没有PHP调用图片安全接口imgSecCheck的demo?
谢谢大佬们
2021-08-24 - php7.4 图片检测security.msgSecCheck一直返回空?
$accessToken = $this->getAccessToken(); $url = "https://api.weixin.qq.com/wxa/img_sec_check?access_token={$accessToken}"; $curl = curl_init(); if (class_exists('\CURLFile')) { curl_setopt($curl, CURLOPT_SAFE_UPLOAD, true); $data = array('media' => new \CURLFile($imgUrl));// } else { curl_setopt($curl, CURLOPT_SAFE_UPLOAD, false); $data = array('media' => '@' . $imgUrl); } curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_USERAGENT, "TEST"); $result = curl_exec($curl); if ($result === false) { echo "error:" . curl_errno($curl); exit; } dd($result); 返回一直为空 "" 图片地址 https://******/storage/images/20210818/f8a0ef275e5de50852377b9f5aa40ef1f04d5747.png
2021-08-23