html52.com
我爱小程序-开发者交流社区

请问一个微信服务端 HTTP API uploadFile 的参数问题

问题模块 框架类型 问题类型 终端类型 AppID 基础库版本
云开发 小程序 Bug 工具 wx2daca2e09c843f11 none

uploadFile 官方文档地址

https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/storage/uploadFile.html



请求数据示例

{
    "env": "test2-4a89da",
    "path": "this/is/a/example/file.path"
}


可能是文档这个地方写的不是特别清楚,我一直不能很好理解 path 到底是一个目录还是文件(完整路径)!

反复调试,一直都没解决。

如果 path 传入参数 "test_files/1.jpg" 则调用返回失败:errCode:-503002 errMsg:不具备访问权限 hint: [4A9CGA01882162]

如果 path 传入参数 "test_files/" 同样调用返回失败:errCode:-503002; errMsg:不具备访问权限 hint: [PQXICa03642028]

如果 path 传入参数 "test_files" 还是调用返回失败:errCode:-503002; errMsg:不具备访问权限 hint: [riNuSa05592162]

然后 path 不管你传入 "/test_files" 还是 "/test_files/" 都是一样返回失败:

errCode:-503001; errMsg:Invalid path: "/test_files" hint: [4Cl.ea04302028]

errCode:-503001; errMsg:Invalid path: "/test_files/" hint: [6KM9oa05322028]


以为是path写的目录要手工建立,我就在微信IDE里面的云开发窗口下面,云存储里面新建了文件夹test_files,问题都一直没有解决。

实在是没办法理解这个参数,也找不到相关的帖子,在此希望知道的朋友指导一下为什么。

谢谢


评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付