- Documentation
Torch Object Storage
SDK Reference
C++
Object Interface
Copy Object
Standard Copy (C++ SDK)
Copy Object
Standard Copy (C++ SDK)
Standard Copy (C++ SDK)
The copyObject operation enables copying objects between buckets within the same region, as well as copying objects within a single bucket. During copying, you can specify new metadata or retain the metadata of the source object.
Precautions
- File copying does not support cross-region bucket-to-bucket copying.
- When copying an object, the account must have read permission for the source object and write permission for the destination bucket.
- When copying an object, you can retain all metadata (by default) or specify new metadata. However, the ACL was not retained; instead, it was set to private.
Sample Code
Standard Copy
When the object is smaller than 5 GiB, you can use standard copy. The following code copies the srcdir/exampleobject.txt object from the srcbucket bucket to the destbucket bucket and sets the object name to destdir/exampleobject.txt.
Inherit source object metadata during copy
Overwrite object metadata during copy
Relevant Documentation
For the API documentation on standard copy operations, refer to CopyObject. Last updated: 2025.09.25 14:22:47