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

云文件下载问题?

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)

                  }

                })

              }})

 云文件已经上传上了,但是下载不了,提示为


  1. {statusCode: 500, header: {…}, cookies: Array(0), errMsg: "downloadFile:ok"}
  2. cookies: []errMsg"downloadFile:ok"header: {}statusCode500__proto__: Object


评论 抢沙发

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

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

云免签H5支付