Simple Copy

Last updated: 2019-10-15 20:55:32

PDF

Use Cases

The copy operation creates a copy of an object that is already stored in COS. You can create a copy of your object up to 5 GB in a single operation. To copy an object over 5 GB, you must use the multipart upload API. With the copy operation, you can:

  • Create a copy of an object.
  • Rename the object by copying it and deleting the original one.
  • Modify the storage class of the object. In the copy operation, you can select the same object key as both the source and destination and modify the storage class.
  • Copy objects across different COS regions.
  • Modify object metadata. In the copy operation, you can select the same object key as both the source and destination and modify object metadata.

In the copy operation, the metadata of the original object is inherited by default, but the creation date is subject to the new object.

Directions

Via REST API

You can use the REST API directly to initiate an object copying request. For more information, see PUT Object - Copy.

Via the SDK

You can directly call the object copying method in the SDK. For more information, see the SDK documentation for the corresponding programming language below: