Javascript 以react native格式将pdf文件从存储器上载到firebase

Javascript 以react native格式将pdf文件从存储器上载到firebase,javascript,firebase,react-native,blob,Javascript,Firebase,React Native,Blob,我一直在尝试将PDF文件从手机存储器上传到Firebase。当我使用react native document picker选择一个pdf文件时,它可以正常工作,该文件返回的路径类似于content://com.android.externalstorage.documents/document/primary%3Adocs%2F“+”.pdf” 然后将其传递给fetch const response = await fetch(path); blob = await response.

我一直在尝试将PDF文件从手机存储器上传到Firebase。当我使用
react native document picker
选择一个pdf文件时,它可以正常工作,该文件返回的路径类似于
content://com.android.externalstorage.documents/document/primary%3Adocs%2F“+”.pdf”
然后将其传递给fetch

  const response = await fetch(path);
  blob = await response.blob();
然后blob被上传到Firebase

但问题是我不想每次都选择一个文档。如果我不使用
react native document picker
,只需管理模块返回的确切路径。它在传递给fetch时会出现网络错误,因此无法创建blob。 我还尝试了
react native fs
,但不知道如何创建驻留在模拟存储中的PDF blob