小程序
小游戏
企业微信
微信支付
扫描小程序码分享
这个函数不知道怎么死活没有反应
// wx.getFileInfo({
// filePath: filePath,
// success(res) {
// console.log('get: ' + res.size)
// console.log(res.digest)
// },
// fail: function (res) {
// console.log('fail:' + res)
// }
// });
6 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
工具上的话应该是已知问题,getFileInfo只会进入complete回调。你可以试一下。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
你好,请提供一下出现问题的机型和微信版本。工具上目前有个bug,只会回调complete,建议再真机上试一下看看。
本地文件指用saveFile保存到本地对文件。其他接口调用返回的文件都属于临时文件
谢谢 原来真的是需要在手机上测试才可以
情况正如你说的,谢谢 !
你好,我是在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],
var savedFilePath = res.savedFilePath
console.log('savedFilePath' + savedFilePath);
that['tempFilePath'] = savedFilePath;
}
})
});
},
getFileApi: function () {
// var filePath = that['tempFilePath'] ;
wx.getSavedFileList({
console.log(res.fileList)
that.setData({ images: res.fileList })
文档提到:
本地文件、临时文件
这两个概念怎么理解?
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
工具上的话应该是已知问题,getFileInfo只会进入complete回调。你可以试一下。
你好,请提供一下出现问题的机型和微信版本。工具上目前有个bug,只会回调complete,建议再真机上试一下看看。
本地文件指用saveFile保存到本地对文件。其他接口调用返回的文件都属于临时文件
谢谢 原来真的是需要在手机上测试才可以
情况正如你说的,谢谢 !
你好,我是在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 })
}
})
}
文档提到:
本地文件、临时文件
这两个概念怎么理解?