Uploading images to firebase "Error loading preview"

Hi guys,

This time I have a problem trying to uploading images to my backend “firebase”.

I read some tutorials like this:

https://forums.appgyver.com/t/upload-files-to-firebase-storage-tutorial/6428

I didn’t try this:

https://forums.appgyver.com/t/how-to-upload-files-to-backendless-step-by-step/6431

Just because I don’t have idea about JS.

This is my current flow function:

And this is how I have the setup about the vars and http request:

Vars = an object with 6 properties (to storage the info from pick’s image output)

Properties:
• name • path • mimeType • size • createdAt • modifiedAt

and the request url is the next:

"https://firebasestorage.googleapis.com/v0/b/MY-PROJECT-NAME.appspot.com/o/"+VAR_NAME+".png?uploadType=media"

Header = Content-Type: image/png

Request body = the whole object from the vars with each property.

I get a good response from firebase, with all the information, but when I try to see the image in the backend, it looks like was uploaded in the wrong way/format and the size is in “BYTES” and looks like this:

I tried postman and works good, what could I be missing? @ JOHN_WORSHAM did you solve this in someway?, do you think you can help with this trouble?

POSTDATA: I can’t use firebase storage upload files flow function because I don’t use the firebase auth flow function, I did the auth part through http requests.

image

You don´t need to use Firebase auth to do this. Mine works ok.

Did you initialise Firebase?

No, I didn’t because the flow function say firebase needs to be initialized before so I though was needed to do the auth through it to make it works.

I’ll give a shoot to this through this way and come back with news, thanks for the time to reply this post Phil :slight_smile:

Thanks you very much @Phil_Evans , it works like a charm.

I didn’t know isn’t necessary to do the firebase auth to make this flow work.

1 Like

No problem. Its nice to see a well written question, it is so much easier to help with, especially with the diagrams.

1 Like