Skip to main content

Error 400 when using /fetch API

Comments

3 comments

  • Aleksandar Kostadinov

    Hi Andrew,

    The X-Cld-Error response header value you're seeing is related to the length of the public_id which for Fetch resources is the whole remote URL. By default, this limit is 255 characters, however, in your case, the remote URL is less than 255 characters. The reason for the error is that the specified transformations have been picked up as part of the public_id because they contain an invalid transformation parameter which causes the parsing to incorrectly interpret them as part of the public_id which then results in the value going above the 255 limit. 

    Specifically, fetch_format:jpg is not a valid transformation in URLs. fetch_format is the parameter name that should be used when specifying this transformation via one of our SDKs, but in URLs, the fetch_format is specified using (f_) which you are already using, therefore, you won't need this included again.

    Making this change produces the following URL:

    https://res.cloudinary.com/gumball/image/fetch/q_auto:best,dpr_2.0,f_auto,g_north,c_fill,fl_force_strip,w_128/https://content.production.cdn.art19.com/images/33/9d/a2/12/339da212-5ab6-461c-a014-302408cb328d/ede37b0b92f5799367ffaaa1f9d4a24fd1587f5037861fba41fdb34c330d98dc2869e629367941d87abacf6e8fbcfe51cd5e2e36f0d90c44b1cdfc1da6ec4059.jpeg

    Accessing the above leads to a different error and if you inspect the X-Cld-Error header this time you will see the following:

    File size too large. Got 12419652. Maximum is 10485760.

    On our Free plans, the maximum image file-size limit is 10 MiB and as the remote image is larger than this it hits that limit and isn't allowed to be uploaded. However, if you use the same transformations but replace the remote image URL with one that is below 10 MiB then that should work for you.

    Best regards,

    Aleksandar

    0
  • Andrew Pile

    Hi Aleksandar-

     

    Thanks for the quick response. I've removed the "fetch_format" parameter and upgraded to the Plus plan. However I'm still getting: x-cld-error: File size too large. Got 12419652. Maximum is 10485760.

     

    What are the upload limits for Plus?

     

    Thanks!

    0
  • Andrew Pile

    It appears it just took some time for this to work. All good now, thanks!

    0

Post is closed for comments.