-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
企业微信上传文件的接口是错的,引起媒体文件为空 #2992
Comments
@carto1111 方便把你能重现问题的代码展示一下吗? |
大师,SDK源码里 /// 上传临时媒体文件【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);
|
@carto1111 您好,您指的接口有错误是,https://developer.work.weixin.qq.com/document/path/95178,这个接口么 而企业微信里是,/cgi-bin/media/upload_attachment?access_token=ACCESS_TOKEN&media_type=TYPE&attachment_type=1 还有POST的请求包中,form-data中媒体文件标识,应包含有 filename、filelength、content-type等信息 |
问题描述
你好,上传文件的接口是错的,media直接传的是文件路径,没有filename、filelength、content-type等
模块对应的 .net 版本
开发环境
缓存环境
系统环境
The text was updated successfully, but these errors were encountered: