开发者

How to delete files using the right-aws gem

开发者 https://www.devze.com 2023-02-12 04:52 出处:网络
I need to find out how to delet a file on my S3 bucket using the right-aws gem (https://github.com/rightscale/right_aws). The current doc (the README at github) isn\'t very helpful...

I need to find out how to delet a file on my S3 bucket using the right-aws gem (https://github.com/rightscale/right_aws). The current doc (the README at github) isn't very helpful...

Has anyone tried doing som开发者_运维知识库ething similar and would like to share their findings?


The best is AWS::S3


RightAws::S3::Key have a method called delete. Click here for documentation.


With the newly released aws-sdk gem you can delete a file like so:

s3 = AWS::S3.new(:access_key_id => '...', :secret_access_key => '...')
s3.buckets['YOUR_BUCKET_NAME'].objects['OBJECT_KEY'].delete
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号