Skip to main content

Auto Upload not working -- not sure if it has to do with the image URL I am trying to upload

Comments

2 comments

  • Aleksandar Kostadinov

    Hi Kyle,

    Looking at the logs for your account I can see why you're receiving an error. The reason is that the source URL requires the last forward slash for the request to work. For example,

    https://ucarecdn.com/2798dbc4-cb95-42a9-8bb3-52fa24ff70e2/-/resize/300x/ - Works
    https://ucarecdn.com/2798dbc4-cb95-42a9-8bb3-52fa24ff70e2/-/resize/300x - Throws an error

    Now, the Cloudinary auto-upload URL you're using to access the image:

    https://res.cloudinary.com/<cloud name>/image/upload/tys/2798dbc4-cb95-42a9-8bb3-52fa24ff70e2/-/resize/300x/

    has the trailing slash as per the source URL, however, our system expects the image name to be the last part of the URL and it isn't expecting it to end without anything following the slash so it throws an error.

    After looking into this further it seems the source URLs allow you to specify any string after the ..300x/ so what I've gone ahead and done is added a placeholder image name "test-image.jpg" to the end of the source URL - https://ucarecdn.com/2798dbc4-cb95-42a9-8bb3-52fa24ff70e2/-/resize/300x/test-image.jpg this would then allow me to use the auto-upload mapping and accessing this image via https://res.cloudinary.com/dhvgjssfm/image/upload/tys/2798dbc4-cb95-42a9-8bb3-52fa24ff70e2/-/resize/300x/test-image.jpg which retrieves the images from the remote URL as expected.

    If you're not able to add these to the source URLs directly you can use this approach when auto-uploading the resources.

    Best regards,

    Aleksandar

    0
  • Kyle Brewer

    Thank you so much this worked perfectly

    0

Post is closed for comments.