no response from destroy method

Comments

6 comments

  • Avatar
    Aditi Madan

    Hi,

    Can you please share the public_id of the resource/s that you are trying to delete and I will be able to check the logs further?

    Best,

    Aditi

    0
    Comment actions Permalink
  • Avatar
    hawrekamal

    Hi there,

    Here are the publicIds: products/nvqxgq8brww9yyhhxjdk, products/q8prqylgrrmaw0jy63im

    0
    Comment actions Permalink
  • Avatar
    Stephen Doyle

    Hi,
    We weren't able to find any destroy() API call logs for your account for either of the specified public_id values - are you sure that the HTTP requests are being made to api.cloudinary.com from your code?

    Also, can you confirm which version of our Node.JS SDK you're using, and how the SDK is configured in your application? Are you certainly adding `var cloudinary = require('cloudinary')` at the top? If not, I'd expect to see some console errors from your server, but it's worth verifying that the SDK is installed and configured correctly

    Thanks,

    Stephen

    1
    Comment actions Permalink
  • Avatar
    hawrekamal

    Hi Stephen,

    I realized that no request is made at all, and the reason was that I was trying to use destroy method directly on the client-side(React.js) code which isn't possible.

    I am not using node.js or any other server-side languages in my project what can I do to deleting the images?

    0
    Comment actions Permalink
  • Avatar
    Stephen Doyle

    It's not possible to delete images from the client-side directly because there's no way to authenticate such a request using details stored in the client - if you had your account's API secret available to the client, any of your users could use that secret to make arbitrary API calls to your account.

    The usual method of performing destructing actions from a client-side app is that you also have a server-side component and your app makes a request to your server, which then makes a call to our API after checking the request came from an authorized user and they're allowed to make such a request (e.g. they have admin permission, or they 'own' the asset).

    You may need a server-side component for other reasons too, such as handling user logins, storing details about the files a user uploads, etc, so that's a logical place to add a controller to handle deletion or other similar actions

    Thanks,

    Stephen

    0
    Comment actions Permalink
  • Avatar
    hawrekamal

    I'm working with Firebase, that why I don't have any server-side component.

    anyway, thanks for the explanation, Stephan.

     

    0
    Comment actions Permalink

Please sign in to leave a comment.