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"}
- cookies: []errMsg: "downloadFile:ok"header: {}statusCode: 500__proto__: Object