Javascript 如何将文件从应用程序文档文件夹移动到Iphone';使用react-native fetch blob创建文档文件夹

Javascript 如何将文件从应用程序文档文件夹移动到Iphone';使用react-native fetch blob创建文档文件夹,javascript,ios,iphone,reactjs,react-native,Javascript,Ios,Iphone,Reactjs,React Native,我正在使用react native fetch blob下载excel文件,这些文件存储在我无法在iphone中打开的app/documents文件夹中,我不知道iphone的document文件夹保存文件的绝对路径 这是我的密码: downloadFile(){ const dirs = RNFetchBlob.fs.dirs; let context = this, userBarRelationId = context.state.userBarId;

我正在使用react native fetch blob下载excel文件,这些文件存储在我无法在iphone中打开的app/documents文件夹中,我不知道iphone的document文件夹保存文件的绝对路径

这是我的密码:

downloadFile(){
    const dirs = RNFetchBlob.fs.dirs;
    let context = this,
        userBarRelationId = context.state.userBarId;
    RNFetchBlob
  .config({
    fileCache : true,
    path : dirs.DocumentDir + '/excel.xlsx'
  })
  .fetch('GET', 'http://localhost:5000/getExcel/'+userBarRelationId, {
  })
  .then((res) => {
    console.log('The file saved to ', res.path(), res.data)
  })
  }

等等,您正在请求将数据保存在“文档”文件夹中,而不是您的沙盒应用程序可以访问的文件夹中

这在iOS设计中是不可能的。另见。谷歌搜索的每一分钟都不能告诉你这一点,更不用说这基本上是一个核心原则

如果我不明白你的意思,我向你道歉,但是我不知道你想知道什么。如果您想知道如何将文件保存到用户的iCloud驱动器(iCloud驱动器也有一个Documents文件夹),您需要投入更多的工作。我自己从来没有做过,但一个好的起点是