Automattic / knox

S3 Lib
MIT License
1.74k stars 285 forks source link

del and deleteFile not actually deleting #244

Open webchaz opened 10 years ago

webchaz commented 10 years ago

Using the following:

var s3 = knox.createClient({
          secure: true,
          bucket: 'xxxx',
          key: 'xxxx',
          secret: 'xxxx'
});

s3.deleteFile('/249817_10150251832903474_4763491_n.1409099878932.jpg', function(err, res){
      console.log(err);
});

I receive no error (null), however when I access the full URL, the image is still available. Any idea why its not be deleting the file from s3?

domenic commented 10 years ago

Check the response body

domenic commented 10 years ago

And status code

webchaz commented 10 years ago

Status code is 204, how do I check the response body?

domenic commented 10 years ago

Well 204 means the body will be empty and S3 thinks it succeeded, so something else must be going on :(

webchaz commented 10 years ago

Yeah, hm... Could there be settings in S3 that would prevent us from deleting?

domenic commented 10 years ago

I mean it could be permissions, but I would think that would give back an error status code... hard to say :(

sonnyp commented 10 years ago

Not sure it helps but: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#deleteObject-property "If there isn't a null version, Amazon S3 does not remove any objects."

rgruesbeck commented 10 years ago

did anyone figure this out? im having the same issue.

ArVan commented 9 years ago

Hi, any news here guys? I just came up to this issue.

mihneasim commented 9 years ago

Make sure the path of the object is correct. And don't provide "folder" paths, S3 has no such concept. That was my mistake at least - trying to delete a "folder" (or rather, a prefix).