<?php
define('APPID', "wx6375555");
require_once "../jssdk.php";
require_once "../interface/common.php";
session_start();
$jssdk = new JSSDK("wx63555a3", "a1fc0faf1c25555555555cc6");
$access_token=$jssdk->getAccessToken();
$file['filename']="/0713/img/071301.png";
$file['content-type']="image/png";
$file['filelength']='1000';
// var_dump($file);
echo $access_token."<br />";
echo add_material($file,$access_token);
function add_material($file_info,$access_token) {
$url = "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token={$access_token}&type=image";
$ch1 = curl_init();
$timeout = 5;
$real_path = "{$_SERVER['DOCUMENT_ROOT']}{$file_info['filename']}";//这里把文件路径补全,使用盘符路径
$data &#
微信jssdk 上传永久图片素材,获取Media_ID
最新推荐文章于 2021-09-02 14:07:27 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)