收藏
回答

云文件下载问题?

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


回答关注问题邀请回答
收藏

2 个回答

  • Mr.Zhao
    Mr.Zhao
    2020-02-25

    2020-02-25
    有用 1
    回复
  • hbzyliyong
    hbzyliyong
    2020-02-25

    我的文件名字命的有问题,不应该有空格,现在可以了。不知云上为什么可以上传带空格的名字,就是不能下载。谢谢

    2020-02-25
    有用
    回复
登录 后发表内容
问题标签