IOS下载xlsx文件成功并打开预览,但是如何发送分享文件和找到文件在手机端位置
IOS下载xlsx文件成功并打开预览,但是如何发送文件分享和找到IOS文件位置 util.js? [sm]:229 util request res=> {statusCode: 200, tempFilePath: "wxfile://tmp_b0e63e53a1b3d5ec406718bb6beedd77.xlsx", errMsg: "downloadFile:ok"} 14:20:15.089 DeliveryManagement.js? [sm]:508 downloadFile res=> {statusCode: 200, tempFilePath: "wxfile://tmp_b0e63e53a1b3d5ec406718bb6beedd77.xlsx", errMsg: "downloadFile:ok"} 14:20:15.090 DeliveryManagement.js? [sm]:519 newPat=> wxfile://usr/单据-2019-01-08).xlsx 14:20:15.320 DeliveryManagement.js? [sm]:541 wx.getFileSystemManager().rename err=> {errMsg: "rename:fail permission denied, open wxfile://tmp_b0e63e53a1b3d5ec406718bb6beedd77.xlsx"} 14:20:15.595 DeliveryManagement.js? [sm]:550 打开文档成功 res=> {errMsg: "openDocument:ok"} 使用 wx.downloadFile 接口获得变量 filePath ,如下图 let filePath = res.tempFilePath; // console.log("downloadFile res=>", res) let newPath = wx.env.USER_DATA_PATH + "/" + filePath.slice(-5); [代码]console.log([代码][代码]"newPat=>"[代码][代码], newPath)[代码][代码] [代码][代码]wx.getFileSystemManager().rename({[代码][代码] [代码][代码]oldPath: filePath,[代码][代码] [代码][代码]newPath: newPath,[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log([代码][代码]' wx.getFileSystemManager().rename res=>'[代码][代码], res)[代码][代码] [代码][代码]wx.openDocument({[代码][代码] [代码][代码]filePath: newPath,[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log([代码][代码]'打开文档成功 res=>'[代码][代码], res)[代码][代码] [代码][代码]self.closePopupTap();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail(err) {[代码][代码] [代码][代码]console.log([代码][代码]'打开文档失败 err=>'[代码][代码], err)[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'文档打开失败'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]"none"[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail(err) {[代码][代码] [代码][代码]console.log([代码][代码]' wx.getFileSystemManager().rename err=>'[代码][代码], err)[代码] [代码] [代码] // ios 命名文件名称失败。。。。 [代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'文件重命名失败'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]"none"[代码][代码],[代码][代码] [代码][代码]duration:2500[代码][代码] [代码][代码]});[代码][代码] [代码][代码]wx.openDocument({[代码][代码] [代码][代码]filePath: filePath,[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log([代码][代码]'打开文档成功 res=>'[代码][代码], res)[代码][代码] [代码][代码]self.closePopupTap();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail(err) {[代码][代码] [代码][代码]console.log([代码][代码]'打开文档失败 err=>'[代码][代码], err)[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'文档打开失败'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]"none"[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码] 想知道这个IOS重命名如何才能成功,这个命名是否成功是否影响到了IOS手机端wx.openDocumen 不知道如何找到文件位置和当前打开无法发送分享文件,安卓端是可以分享的,并重命名找到的。。 [图片]