Creating a copy of an object

Prev Next

The copy_object() method creates a copy of an object already stored on the server.

Example

In this example, we copy the object MyObject from the bucket MyBucket to the bucket MyOtherBucket and name the copy MyObjectCopy.

response = S3_client.copy_object(
    Bucket='MyOtherBucket',
    CopySource='MyBucket/MyObject'
    Key='MyObjectCopy',
)