If the file path looks like file:///.... You can just simple put it to Firebase function, don't need readFile step.
My code works properly up to now:
static uploadProfileAvatar(userID, fileURI) { // file URI is a path of a local imageconstupdateTime=moment().unix();conststoragePath=`${PROFILE_AVATAR_PATH}/${userID}_${updateTime}.jpg`;constfileMetaData= { contentType:'image/jpeg' };returnFirebaseStorage.uploadFile(fileURI, storagePath, fileMetaData); } static uploadFile(fileURI, storagePath, fileMetaData =null) {constuploadTask=firebase.storage().ref().child(storagePath).put(fileURI, fileMetaData);return uploadTask; }
If you have the path like rct-image-store://0. You have to write it to and then get the local path image.
ImageStore.getBase64ForTag(rctFileURI,// rct-image-store: path(base64Image) => {constimagePath=`${RNFS.DocumentDirectoryPath}/${newDate().getTime()}.jpg`;RNFS.writeFile(imagePath,`${base64Image}`,'base64').then((success) => {// now your file path is imagePath (which is a real path)if (success) {// upload with imagePath, same as the 1 } }).catch(() => {});},() => {},);