Reputation: 21
I need to copy a file from one folder to another folder with new name in same aws S3 bucket. Can anyone have idea how I do it with aws-sdk gem or something else?
Upvotes: 0
Views: 1348
Reputation: 19247
bucket = Aws::S3::Bucket.new('bucketname')
new_object = bucket.object('new_key')
aws_response = new_object.copy_from(bucket.object('source_key'))
Upvotes: 1