S3 icon indicating copy to clipboard operation
S3 copied to clipboard

S3.delete does not delete file

Open vertangelx opened this issue 10 years ago • 5 comments

S3.delete does not seem to delete the file when its relative path is used. The S3.delete function returns result with the value true in the callback.

Why isnt the file being deleted off S3? Thank you!

Original URL: https://my.Bucket.s3-ap-southeast-1.amazonaws.com/demo/89fd92d2-98ce-4af2-8e1f-87f213896027-avatar.jpg Relative URL: /my.Bucket/demo/89fd92d2-98ce-4af2-8e1f-87f213896027-avatar.jpg

var S3ImagePath = "/my.Bucket/" + ( Meteor.user().profile.imageUrl.split("/").slice(3).join("/") )
console.log(S3ImagePath)
S3.delete( S3ImagePath, function(error, result) {
    if(error)
        console.log('error:', error)
    else
        console.log('result:', result)

I have defined S3.config on the server, but somehow I also noticed that using the wrong credentials doesn't throw any errors

S3.config = {
    key: 'mykey',
    secret: 'mysecret------/eYKWn9K+7v07IL',
    bucket: 'my.Bucket'
};

vertangelx avatar Jan 17 '15 03:01 vertangelx

I'll have a look as soon as I get a chance

Lepozepo avatar Jan 17 '15 17:01 Lepozepo

Hi, there might be something wrong with the way you're calculating the path of the image. No one else has had this issue plus I tested it quite a bit to make sure I wasn't missing anything. What error message are you getting? Were you able to solve it?

Lepozepo avatar Mar 13 '15 23:03 Lepozepo

hi! I have the same here. The S3.delete result returns true, but file is still on the server. Tried with (/file.jpg' and 'file.jpg' too and both have the result described.

geritol avatar May 28 '15 07:05 geritol

Hi! I have the same here, Result returns true, but file is not deleted.

penguinoz avatar Dec 29 '16 10:12 penguinoz

Hey guys! I'm almost done with the new version of this package, in the new version I plan to remove the dependency on Knox. I'm not sure why some people are having this issue >_<

Lepozepo avatar Dec 29 '16 22:12 Lepozepo