Delete raw files is not working

Comments

3 comments

  • Avatar
    Francis Tagbo

    Hi there,

    I checked our logs and I couldn't see a failed destroy request for the public id "it/test.txt". I am thinking it didn't reach us. I noticed in your code that the value "raw" is missing a double quote to enclose the value.
    Another thing that you could try is to hard code the public id to make sure you are passing the correct value.

    You could try this code:

    Map options = ObjectUtils.asMap("invalidate",true,
    "resource_type","raw",
    "type","upload");
    result = client.uploader().destroy("it/test.txt", options);


    Please let me know how it goes.

    Thanks,
    Francis

     

    0
    Comment actions Permalink
  • Avatar
    CloudAccount WARDA

    Hi Francis,

    I tried with the file with publicId

    it/doc

    but I'm getting the same results. Could please you check and let me know?
    My code is basically identically to the yours, I'm only using constant for the Map keys and not hard coded strings.

     

    Best regards,

     

    Alberto

    0
    Comment actions Permalink
  • Avatar
    Francis Tagbo

    Hi Alberto,

    Yes, I intentionally hardcoded the strings to make sure the values are correct.
    I checked your account to see the resource `it/doc`. This asset is a pdf file and it was uploaded with resource_type `raw`. Please note that for `raw` files, the file extension is included in the public id.

    Could you please use the public id "it/doc.pdf" in your destroy request? Please let me know the results.

    Regards,
    Francis

    0
    Comment actions Permalink

Please sign in to leave a comment.