This support forum is no longer in use. Please use the Cloudinary Community at https://community.cloudinary.com/ to receive assistance from other members of the community and from Cloudinary's support team. For account-specific questions or if you believe that you've encountered a bug, please contact the Cloudinary team directly via the "submit a request" option on this support site.

Get URL in Callback Response with Simple Upload Form

Comments

1 comment

  • Avatar
    Daniel Mendoza

    Hi,

    My question is: since I'm setting the public_id value, and the file's extension/type is returned to me, I can still access the image publicly by visiting cloudinary.com/mycloudname/image/upload/foofoo.png  (that is, omitting the v1648074883 part of the URL, which I never receive).Is this fine, expected behavior?  Just want to make sure this method of referencing (going straight to /upload/filename.extension) isn't going to disappear in some future build.  

    • The full version e.g. `v1648074883` can be omitted from the URL. It is used mainly for cache busting, meaning you want to pull the latest version of the image, you can just update that value to the current timestamp and it will fetch the latest asset.

    Hitting an image at /upload/filename isn't ideal, because if a user uploads several times and they are all saved as filename foo, the CDN may not cache the latest one right away, so I end up with a variety of "foo" images showing up until the CDN finally catches up. 

    • If they all have the same public id, just make sure to include the parameters `invalidate` and `overwrite` set to true, and those assets will be invalidated at the CDN, so you should always get the latest. When you destroy an asset you should also do `invalidate` set to `true`.

    or future releases, returning the full URL as part of the callback GET payload during a basic web POST might be helpful, so we can reference the latest image and avoid caching issues.

    • This shouldn't matter, the upload response you shared has everything you need to generate the cloudinary URL. In your database you should save `public_id`, `format`, `resource_type`, `type` and if needed `version`. With these parameters you can generate the Cloudinary URL via one of our SDKs or just by constructing it yourself here.

    Hope this helps.

     

    0
    Comment actions Permalink

Post is closed for comments.