腾讯作妖不是一两天的时,要不是垄断社交,没几个人愿意用企业微信!一如以往的烂文档,让你每一次去用其api都会有种吔屎的感受!
-------------------
原文介绍:
哎,真心让人觉得恶心到吐!
实际上只需要:
curl post中的参数包括有
filename:文件路径;
content-type:只有两个可能,要么是image/png,要么是image/jpg,本来就只支持这两个。
$tmp="../abc/123.png";
$ext=$tmp[count($tmp)-1];
$ftype=strtolower($ext)=="png" ? "png" :"jpg";
$filedata = array (
"filename" =>$tmp,
"content-type" =>'image/'.$ftype,
);
$token=getToken();
$url = "https://qyapi.weixin.qq.com/cgi-bin/media/uploadimg?access_token=".$token;
$res = ihttp_request($url, $filedata, array());
……
//后面的自己补全就好。