Uploading the same image file with different crop doesn't update version


1 comment

  • Avatar
    Michal Kuperman

    Hi Paul,

    When uploading an image to Cloudinary we check to see if the same exact file with this public_id already exists on your cloud. If we detect that the same exact image with this public_id already exists on your account we don't upload it again. So re-uploading the same file with different coordinates won't overwrite the existing file.

    What you can do, is first delete the existing file with this public_id and then re-upload the new image. Deleting the image can be done in two ways:
    1. Using the destroy method via your server-side (don't forget to include the `invalidate` parameter set to `true`) As explained here: https://cloudinary.com/documentation/image_upload_api_reference#destroy.
    2. Deleting via the upload widget by setting the `Return delete token` parameter to `true` in your upload preset. Then in your upload widget configuration, you would need to set the `thumbnails` parameter to the id of the HTML element that would be set as the container for the upload thumbnails. After your user clicks 'done' and uploads the image, he would see a thumbnail with an X on the top which would allow him to delete the image. This delete option is available for only 10 minutes after the image was uploaded. You can read more about this delete option here: https://cloudinary.com/documentation/upload_images#deleting_client_side_uploaded_assets.

    Alternatively, you can use the explicit method on your server-side, to update the coordinates of an existing image.
    More info here: https://cloudinary.com/documentation/image_upload_api_reference#explicit

    Let us know if you need any further assistance.

    Best regards,

    Comment actions Permalink

Please sign in to leave a comment.