收藏
回答

getFileInfo(Object)

这个函数不知道怎么死活没有反应


// wx.getFileInfo({

    //   filePath: filePath,

    //   success(res) {

    //     console.log('get: ' + res.size)

    //     console.log(res.digest)

    //   },

    //   fail: function (res) {

    //     console.log('fail:' + res)

    //   }

    // });


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

6 个回答

  • 晨
    2017-08-10

    工具上的话应该是已知问题,getFileInfo只会进入complete回调。你可以试一下。

    2017-08-10
    有用
    回复
  • 晨
    2017-08-10

    你好,请提供一下出现问题的机型和微信版本。工具上目前有个bug,只会回调complete,建议再真机上试一下看看。

    本地文件指用saveFile保存到本地对文件。其他接口调用返回的文件都属于临时文件

    2017-08-10
    有用
    回复
  • 第一桶金
    第一桶金
    2017-08-20

    谢谢  原来真的是需要在手机上测试才可以

    2017-08-20
    有用
    回复
  • 宽恕
    宽恕
    2017-08-10

    情况正如你说的,谢谢 !

    2017-08-10
    有用
    回复
  • 宽恕
    宽恕
    2017-08-10

    你好,我是在pc开发工具iphone6测试:源码

     //保存文件api演示函数

      saveApi: function () {

        var that = this;

        wx.chooseImage({

          success: function (res) {

            var tempFilePaths = res.tempFilePaths

            that['chooseFile'] = tempFilePaths;

            console.log('tempFilePaths' + tempFilePaths);

            wx.saveFile({

              tempFilePath: tempFilePaths[0],

              success: function (res) {

                var savedFilePath = res.savedFilePath

                console.log('savedFilePath' + savedFilePath);

                that['tempFilePath'] = savedFilePath;

              }

            })

          }

        });

      },

      getFileApi: function () {

        var that = this;

        // var filePath = that['tempFilePath'] ;

        // wx.getFileInfo({

        //   filePath: filePath,

        //   success(res) {

        //     console.log('get: ' + res.size)

        //     console.log(res.digest)

        //   },

        //   fail: function (res) {

        //     console.log('fail:' + res)

        //   }

        // });


        wx.getSavedFileList({

          success: function (res) {

            console.log(res.fileList)

            that.setData({ images: res.fileList })

          }

        })

      }


    2017-08-10
    有用
    回复
  • 宽恕
    宽恕
    2017-08-10

    文档提到:

    本地文件、临时文件

    这两个概念怎么理解?


    2017-08-10
    有用
    回复
登录 后发表内容