Destroy an image using angular

Comments

1 comment

  • Avatar
    Mo Ip

    Hi Nathan,

    Deletion requests are all based on signed API and therefore are only available via the server-side SDKs (e.g. Java, Rails, NodeJS, etc.).  Therefore you cannot use Angular to do the deletion.

    You can certainly use Angular to do signed uploads.  This is done on the server-side so the signature generation will be done there.  This is because the signature is based on your account's api_secret which must be excluded from your client-side code.  Please refer to https://support.cloudinary.com/hc/en-us/community/posts/207777389-Signed-Upload-on-Angular for the explanation.  

    Here is a step-by-step implementation of doing upload using Angular: https://cloudinary.com/blog/file_upload_with_angular_or_angularjs_to_cloudinary

    If you are uploading subsequent images with the same public_id, then you can set invalidate=true and overwrite=true.  This way the subsequent uploads will overwrite the existing one.

    On the other hand, if you are uploading images that have different public_id, then you can use our server-side SDK to do the deletion:  https://cloudinary.com/documentation/admin_api#delete_resources

    I hope this helps and let us know if you need further assistance,

    Regards,

    Mo

    Cloudinary Dev Support

    1
    Comment actions Permalink

Please sign in to leave a comment.