Expo and uploading image Blobs?

This one GitHub - mathiasbynens/base64: A robust base64 encoder/decoder that is fully compatible with `atob()` and btoa()`, written in JavaScript.

2 Likes

Wow! works! thank you so much!

This solution worked really well for me for a while, but eventually I started getting these errors:

FirebaseStorageError {
  "code_": "storage/retry-limit-exceeded",
  "column": 29,
  "line": 12091,
  "message_": "Firebase Storage: Max retry time for operation exceeded, please try again.",
  "name_": "FirebaseError",
  "serverResponse_": null,
  "sourceURL": "http://192.168.0.102:19002/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=true&minify=false",
}

It happens every time on all but the smallest images. I don’t think my Firebase storage is full, but I’m not sure how to check.

Recently, your solution worked nicely in IOS but when I try this in android, it won’t work.
Error message is as below.

Possible Unhandled Promise Rejection (id: 0):
FirebaseStorageError {
“code_”: “storage/retry-limit-exceeded”,
“column”: 29,
“line”: 12256,
“message_”: “Firebase Storage: Max retry time for operation exceeded, please try again.”,
“name_”: “FirebaseError”,
“serverResponse_”: null,
“sourceURL”: “http://192.168.43.237:19001/main.bundle?platform=android&dev=true&hot=false&minify=false”,
}

It works just fine in IOS but not in Android. Can you please tell me about this?

I have same problem in android, but I think if don’t allow user to edit the pic which means set allowsEditing=false, then it works fine. Still need to dig out why is that though.

I already set allowsEditing=false but still not working in Android …

I have the same problem on android (I have tried on IOS).

FirebaseStorageError {
code_: "storage/retry-limit-exceeded", 
message_: "Firebase Storage: Max retry time for operation exceeded, please try again.", 
serverResponse_: null, name_: "FirebaseError"}

It works with little image. But with “big” image (>200ko), it doesnt work.

1 Like

same issue, so it’s still not possible to upload images to firebase with expo.

It worked… Thank you

Did anyone tried this issue on Android? It will never work in Android and I really need to fix this!

1 Like

i tried but its give me other error "can currently only create a blob from other blobs "

3 Likes

Just to confirm what everyone else already said. This solution usually don’t work on Android, and after switching to expo SDK 21, it doesn’t work on iOS anymore as well. It gives: “can currently only create a blob from other blobs” error.

Is there any other solution to upload images from imagepicker to firebase?

1 Like

I agree. This solution was working for me on android and ios with expo 20 but it does not work anymore with expo 21.

1 Like

Hi guys I solved this problem like this!

           _pickImage = async () => {
                      let result = await ImagePicker.launchImageLibraryAsync({
                        allowsEditing: true,
                        aspect: [4, 3],
                        base64:true
                      });
                  
                     if (!result.cancelled) {
                        this.setState({ imageto: result.uri });
                        const obj = {
                            key:this.state.uid,
                            title: this.state.Title,
                            Descripcion: this.state.Descripcion,
                         image: result.base64
                        }
                        Helpers.createNewPicture(this.state.uid, obj)   
                      }
                    };

I got the base64 from de picture that I selected so I upload the string and I called it like this

          <Image
                source={{uri:`data:image/jpg;base64,${Base64String}`}
                 style={styles.image}
             />

    **_finally I decoded the base64 like this_**
1 Like

Well then… I am not going to be using firebase storage am I right? If using your solution it will be only dependent on firebase database. Am I right?

If then… I can’t accept your question because firebase database will get really large.

Please help us. This is a serious problem…

2 Likes

I used firebase to upload just the string but you can use a different one.
I just storage base64 string and I called it

Hi Everybody, can you upload audio files to firebase storage? thanks

Hello, are you available to upload to firebase storage? thanks

Please send help, this issue needs resolving