Firebase Storage and Cloudinary
I am trying to upload a file from my firebase bucket to cloudinary but it sends
message: 'Error in loading http://res.cloudinary.com/amberinc/image/fetch/https://firebasestorage.googleapis.com/v0/b/amber-prod.appspot.com/o/images/wallpaperflare.com_wallpaper%20%281%29_1609362849556%3Falt%3Dmedia - 400 Bad Request',
-
Hi Samson,
When reaching the URL https://firebasestorage.googleapis.com/v0/b/amber-prod.appspot.com/o/images/wallpaperflare.com_wallpaper%20%281%29_1609362849556%3Falt%3Dmedia I have an `Invalid HTTP method/URL pair` error. Could you share the link to the image in firebase?
Best,
Loic
0 -
Hi Samson,
This error returned when the URL we're trying to fetch the image from includes special characters. In this case '?'. URLs must be escaped for special characters for fetching. In this case, the solution is to either escape the '?' special character (by replacing it with '%3F') Or to fully escape the whole URL,
If you use the updated image URL below, it will fetch the image correctly:
https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Famber-prod.appspot.com%2Fo%2Fimages%252Fwatch-dogs-2-sitara-dhawan-render-3-woman-holding-black-and-blue-tumbler-png-clipart_1593206709107%3Falt%3Dmedia%26token%3Da42c3f00-89d2-4ce1-9893-da0a5c039f6e
Also, SDK have some sort of URL encoding function. Example for JS:encodeURIComponent('https://firebasestorage.googleapis.com/v0/b/amber-prod.appspot.com/o/images%2Fwatch-dogs-2-sitara-dhawan-render-3-woman-holding-black-and-blue-tumbler-png-clipart_1593206709107?alt=media&token=a42c3f00-89d2-4ce1-9893-da0a5c039f6e')Please let us know if that assists.
Thanks,
Mahdi
0 -
It worked but in my cloudinary console i have two of the same files but different names.
Please explain why?
0 -
Samson, Thanks for the update. Please can you explain further if you're using fetch or API to upload these files?
0
Post is closed for comments.
Comments
5 comments