protected $mediaUrl=‘https://api.weixin.qq.com/cgi-bin/media/upload?access_token=’;
protected $otherUploadImglUrl=‘https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=’;
上面第一个是临时素材,第二个是永久素材,
用的是同一段代码
$data = [
‘multipart’ => [
[
‘filename’=>basename($path),
‘filelength’=>$Info,
‘content-type’=>mime_content_type($path),
‘contents’=>fopen($path, “r”),
‘name’=>basename($path),
],
],
];
结果就是临时上传成功,永久的上传失败.
用的是guzzle