尝试使用 RNFetchBlob api 调用 POST 下载 excel - React Native

问题描述

我正在尝试使用 RNFetchBlob 包下载 excel 文件。我要下载的代码(授予权限后看起来像这样)

actualDownloadPDF=async()=>{
 console.log("Inside download")
 let dirs = RNFetchBlob.fs.dirs
await RNFetchBlob.config({
    path : dirs.DownloadDir + '/path-to-file.xsls'
 })
.fetch('POST','uri',{      'tenantid': '1','Content-Type': 'application/json','language': '1','userid': '11'
  },{"fieldId":3169,"direction":1},"listType":0,"searchOverSeperateWords":false})
 )
 .then((res) => {
// the temp file path
console.log('The file saved to ',res.path())
 }) .catch((errorMessage,statusCode) => {
// error handling
 })
}

我可以看到控制台消息:文件保存到/storage/emulated/0/Download/path-to-file.pdf) 正在显示,但我看不到任何文件。另外,如果有人可以帮助我进行扩展,因为 它是一个excel文件。有什么办法可以提示用户选择路径而我看不到任何路径 下载到指定路径的文件。我是不是错过了什么

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)