CopyObject Method

Copies an object.

Syntax

int CopyObject(const QString& qsSrcObjectName, const QString& qsDestBucket, const QString& qsDestObjectName);

Remarks

THis method copies the object specified by SrcObjectName (in the bucket currently selected by Bucket) to the object specified by DestObjectName in DestBucket. If DestBucket is empty, the bucket specified by Bucket is used as the destination bucket.

If the VersionId property is non-empty, the specified version of the source object will be used as the copy source. In this case, DestObjectName may be the same as SrcObjectName to "promote" the version, copying its contents back to the base object.

If there are any metadata items present in the Metadata* properties, they will set on the destination object; otherwise, the server will copy any metadata items present on the source object to the destination object.

Notes:

  • Objects may only be copied to buckets that exist within the same region.
  • Objects larger than 5GB cannot be copied using this method. To copy such objects, start a new multipart upload for the destination object using StartMultipartUpload, and then use the CopyPart method to create parts for said multipart upload using the source object's data.

Error Handling

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Qt Edition - Version 20.0 [Build 8265]