@cloudinary/url-gen generates wrong url while trying to retrieve images in a folder

Comments

1 comment

  • Avatar
    Thomas Gurung

    Hi Kristiyan,

    Thanks for reaching out. 

    The first image is not found because it seems you saved the image with its extension, so the public id for it is actually "2022-04-26T08-43-44.294Z-watch.webp". If you include a . character in a public ID, that simply becomes part of the ID itself.

    If you were to pass "2022-04-26T08-43-44.294Z-watch.webp" to the URL generator then you'd get:

    https://res.cloudinary.com/dmu2k144t/image/upload/v1650962083/twittclone/2022-04-26T08-43-44.294Z-watch.webp.webp?_a=AJAEtWI0 

    which works but we recommend not to include the extension in the public id for media-related sources so you can just update the asset to not have ".webp" in its public id and your code should work.

    I recommend reading the note in this link, please let me know if you have any questions.

    Kind Regards,
    Thomas

    0
    Comment actions Permalink

Please sign in to leave a comment.