I am trying to capture an audio file that has been saved locally and uploaded using firebase. I tried using react-native-fetch-blobas follows:
import RNFetchBlob from 'react-native-fetch-blob'
const fs = RNFetchBlob.fs
but I get an error:
Error: file not exists
Despite the fact that I use the same path, I return after saving the file. Therefore, I have:
console.log('Full path is ' + fullPath) // Gives /var/mobile/Containers/Data/Application/2446[...]E1A9/Documents/myfile.mp4
but then I'm trying
fs.readFile(RNFetchBlob.wrap(fullPath), 'base64').then((data) => ...
I get a "file does not exist" error.
Does anyone have an example of code for reading a (binary) file as a blob and using it, especially for uploading to firebase storage? All the examples I found capture a file from an external URL.
source
share