Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created January 7, 2011 16:13
Show Gist options
  • Save diasjorge/769668 to your computer and use it in GitHub Desktop.
Save diasjorge/769668 to your computer and use it in GitHub Desktop.
class AWS::S3::S3Object
def self.rename_object(from, to, bucket)
old_acl_policy = acl(from, bucket)
put(path!(bucket, to), "x-amz-copy-source" => path!(bucket, from))
acl(to, bucket, old_acl_policy)
delete(from, bucket)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment