Firebase Storage, Product rest API image Upload

beonde
New Member
1 0 1

Hi I am building a webApp (with firebase) for a client.
My question is regarding to the Product rest API.

Problem:
API works fine except for images in this format { src: myurl }.
When I try to upload the image via the admin UI I see the image for a split second then I get
"Image: Media processing failed".
My guess is the firebase storage API here a example url =>

https://firebasestorage.googleapis.com/v0/b/EXAMPLE.COM/o/motorcycles%2Fcount%2Fcount208%2FIMG_0898....

I think shopify is removing the url parameters but I have no clue how to test that.

=> uploads without url parameters work just fine.

 

Possible Solution (kinda ugly):

I could just download the image on the client side => base64 and upload the image in this format  { attachment: myBase64 }.

 

yurikoshiishi
New Member
1 0 0

 

I believe I am facing the same issue using Firebase Storage.

 

Shopify endpoint:   /admin/api/2021-01/products.json (POST)

 

I tried creating products with urls from firebase storage, but Shopify API didn't download images for some reason, even though there's no error thrown.

Just as you described, I ended up encoding images to base64 first and then using "attachment" property instead of "src".

 

I'm not sure if this is a Firebase or Shopify issue. Hopefully Shopify team can take a look at this.

 

0 Likes