wx.saveFile读取文件时错误?
发布于 6 年前 作者 juan70 9288 次浏览 来自 官方Issues

ReadFromFile:function (params) {


  let fsm = wx.getFileSystemManager();

  console.log(wx.env.USER_DATA_PATH),

    wx.saveFile({        

    tempFilePath: wx.env.USER_DATA_PATH + "/Crsmini.txt",

   success(res) {

      fsm.readFile({ 

         filePath:res.savedFilePath,

         encoding: 'utf8',

        success:function(res){

              console.log(res.data)  }

          

       })

     },

     fail: res => {  

      console.info(res)}  

})  

  1. 这里是读取保存的文本问题,提示错误 {errMsg: "saveFile:fail tempFilePath file not exist"}
  2. errMsg"saveFile:fail tempFilePath file not exist"
  3. __proto__: Object
1 回复

你好,麻烦具体描述问题流程,提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

回到顶部