Images with Query String Breaks Fetch...?
Hi Cloudinary Support
I'm working on a project where I'm referencing images from Instagram, via a JSON file.
The issue is that I can't fetch the image, it seems, because they add a query to the end of the URL for the image:
It may be another reason why the fetch on the URL isn't working, but I have feeling that because the URL isn't ending in a file extension the Cloudinary fetch is failing, so I can't use the magical cropping and manipulation tricks you provide...
Do you have any thoughts/insights? Is there a way to force the API to render the image even if it doesn't end in a file extension? Taking the query off the URL sadly breaks the image reference altogether...
Whenever there is a '?' in the URL it needs to be escaped. So you can fetch the photo by doing this:
You just need to replace the question mark with %3F.
It has been a while since I asked the above question, with the solution being to escape the '?' in the URL. However, I've come across an issue with Facebook, where that solution DID work, and now no longer works, for some reason.
Consider this image:
The above link will work fine. If I swap out the '?' for '%3F' and fetch the image with the Cloudinary <cloudname> URL it no longer works:
Is this something on the Facebook side do you think (as it was working fine previously) - or am I missing something?
The example you provided appears to work correctly via my own account: https://res.cloudinary.com/stephencloudinary/image/fetch/https://scontent.xx.fbcdn.net/v/t1.0-9/60872991_1030436307152580_5052963078816137216_n.jpg%3F_nc_cat=107&_nc_oc=AQmYyHbgrah97a7nVTqTkqdNoO5dduqybe5o2KY-gjX2-FiryEgERedsZ14E5-luajlcsEOaqvA0MOi7chF6Bvx0&_nc_ht=scontent.xx&oh=8eea986f2c59184269b5d24294d8c918&oe=5D93A8B1
There could be some account-specific configuration meaning that it works for me but not for you.
For example, there's configuration about the maximum length of filenames, which characters can be used, etc.
May I ask you to please open a support request with the exact URL you're trying including your account name so we can investigate further?
You may also see a reason for the failure in the x-cld-error header of the HTTP response
Thanks for the response. I've taken a look at the x-cld-error message, and it say that the public_id is too long... the URL goes over 256 characters.
I'm a little confused why it did work previously though, and now it doesn't, and why yours works on the same URL, if this is the 256 character limit has been exceeded.
I've logged a support request, as you suggested, as I'm scratching my head a little :)
Post is closed for comments.