步骤2:保存文件 saveFile(tempFilePath){//保存到本地 //文件保存到本地 uni.saveFile({ tempFilePath:tempFilePath,//临时路径 success:res=>{ uni.showToast({ icon:'none', mask:true, title:'文件已保存'+res.savedFilePath,//保存路径 duration:3000 }) setTimeOut(()=>{ //打开文档查看 uni.o...
uni.downloadFile({ url: encodeURI(filePath), //注意中文文件名的网络地址需要encodeURI //url:escape(filePath), //escape(filePath) 另外一种可能出现问题处理方式,安卓打开成功,iOS打开失败【原因:打开的文件的文件名是中文】 success(res) { console.log(res); uni.hideLoading(); //预览图片或打开文件 ...