Comments (2)
大师,SDK源码里
src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Media/MediaApi.cs
这里面的上传方法,教程里面都是直接调用传路径进来,看来是少了media文件标识,微信返回媒体文件为空。
///
/// 上传临时媒体文件【QY移植修改】
///
/// 调用接口凭证(AccessToken)或AppKey(根据AccessTokenContainer.BuildingKey(corpId, corpSecret)方法获得)
/// 媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file)
/// form-data中媒体文件标识,有filename、filelength、content-type等信息
/// 代理请求超时时间(毫秒)
///
public static UploadTemporaryResultJson Upload(string accessTokenOrAppKey, UploadMediaFileType type, string media, int timeOut = Config.TIME_OUT)
{
return ApiHandlerWapper.TryCommonApi(accessToken =>
{
var url = string.Format(Config.ApiWorkHost + "/cgi-bin/media/upload?access_token={0}&type={1}", accessToken.AsUrlData(), type.ToString());
var fileDictionary = new Dictionary<string, string>();
fileDictionary["media"] = media;
return CO2NET.HttpUtility.Post.PostFileGetJson(CommonDI.CommonSP, url, null, fileDictionary, null, null, null, false, timeOut: timeOut);
}, accessTokenOrAppKey);
}
from weixinmpsdk.
@carto1111 方便把你能重现问题的代码展示一下吗?
from weixinmpsdk.
Related Issues (20)
- 退款订单查询提示入参错误,无法实现查询 HOT 5
- 退款回调通知数据无法获取,紧急 HOT 9
- 微信APIv3参数如何填写 HOT 1
- 企业微信接入抛出异常 RequestMessage转换出错!可能是MsgType和InfoType都不存在! HOT 5
- 缺少OCR识别功能 HOT 1
- 企业微信服务商代开发授权成功通知缺少State参数 HOT 2
- 微信推送消息,缺少一个取消授权的类型RequestMessageType HOT 2
- .NET 8 HOT 2
- 企业微信审批模板创建失败 HOT 2
- 微信小程序虚拟支付求支持!!! HOT 1
- 服务商模式 V3退款订单查询 提示缺少sub_mchid HOT 2
- 微信官方更新了URLLINK接口 HOT 1
- Sample/TenpayV3.sln无法正确编译 HOT 2
- 虚拟支付-query_user_balance-返回结果类型"first_save_flag"错误
- 【急】微信支付分取消订单,完成订单都报错,是不是out_trade_no里应该加上JsonIgnore特性? HOT 6
- .net core 7中 始终找不到 UseSenparcWeixin方法 HOT 2
- 微信支付native方式支付回调响应参数没有封装payer.openid这个属性 HOT 1
- 请问,怎样关闭公众号事件推送的日志? HOT 2
- 小程序发货信息管理服务 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weixinmpsdk.