- 当前 Bug 的表现(可附上截图)
- 预期表现
在云开发控制台复制的fileID 不能使用wx.cloud.downloadFile 下载文件
错误信息:
<Error: errCode: -403003 internal server error: empty download url | errMsg: internal server error: empty download url>
console.error @ VM238:1
t.(anonymous function) @ WAService.js:1
(anonymous) @ WAService.js:1
a @ WAService.js:1
(anonymous) @ WAService.js:1
a @ WAService.js:1
t.invokeFailCompleteCallbacks @ WAService.js:1
(anonymous) @ WAService.js:1
Promise.catch (async)
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
exportAPI.(anonymou6
(anonymous) @ WASes function) @ WAService.js:1
onShow @ index.js:15rvice.js:1
__callPageLifeTime__ @ WAService.js:1
(anonymous) @ WAService.js:1
It @ WAService.js:1
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
i.emit @ WAService.js:1
emit @ WAService.js:1
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
n @ appservice?t=1562118605670:1673
(anonymous) @ appservice?t=1562118605670:1673
(anonymous) @ appservice?t=1562118605670:1673
_ws.onmessage @ appservice?t=1562118605670:1673
- 复现路径
cloud://bazi-99zet.6261-bazi-99zet-1259416447/ad.jpg
- 提供一个最简复现 Demo
我也遇到了同样的问题,微信官方为什么不回复下呢?
我今天也出现了这个问题,资源是可以得到的,只是因为这个报错导致进度条跑不完
先使用getTempFileURL换取url,然后再调用downloadFile(fileID)就可以了。
getTempFileURL暗含生成临时下载地址作用。手动捂脸。
wx.cloud.downloadFile 下载文件问题
addImg:function(){
let fsm = wx.getFileSystemManager();
fsm.writeFile({
filePath: wx.env.USER_DATA_PATH + '/tmp.txt',
data: "数据" + rqzh.formatTime(new Date()) + "\n",
encoding: 'base64',
success: res => {
console.log('文件生成',res)
let filepath= wx.env.USER_DATA_PATH + '/tmp.txt'
const cloudPath = "cjdata/" + rqzh.formatTime(new Date())+ ".ccjson"
wx.cloud.uploadFile({
cloudPath: cloudPath,
filePath: filepath,
success: resa => {
console.log('[上传文件] 成功:', resa.fileID)
let fileid=resa.fileID
wx.cloud.downloadFile({
"fileID": fileid,
success: res => {
console.log('文件下在',res)
}
})
}})
运行提示{statusCode: 500, header: {…}, cookies: Array(0), errMsg: "downloadFile:ok"},取不到文件,
我这边也出现的这个问题 前两天还是好的 不知道怎么回事
上面写着下载链接为空,那就是链接有问题,你用的cloudID去显示图片没问题,但是下载要用下载地址
您好 谢谢您的回答
但是 文档上就是用的fileidhttps://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-client-api/storage/downloadFile.html
而且线上稳定运行几个月 这两天才出现这个问题的
之前云开发后台没更新,现在换为新版云开发的可能就失效了