Create the copy of an existed Object, the copy operation is equal to executing GET operation first and executing PUT operation next. Specify source Bucket and source Object to be replicated by x-amz-copy-source Header. In OSS, the maximum single Object that can be operated is 5G. In case of exceeding 5G, please use multipart upload of Upload Part-Copy operation. In order to execute the operation, you need READ permission of the source Bucket and WRITE permission of the Target Bucket.
When OSS receives Put Object-Copy request or it is executing Copy, the request may return an error. If the error occurred before executing Copy, you will receive an standard OSS error; if the error occurred during the Copy, the error of Copy will be embedded into 200 OK response, so Copy of 200 OK response result may be both successful or failed.
PUT /destinationObject HTTP/1.1 Host: <destinationBucket>.s3.<region>.jdcloud-oss.com x-amz-copy-source: /source_bucket/sourceObject Authorization: <authorization string> (see Authenticating Requests (AWS Signature Version4)) Date: <date>
No Request Parameters
Except public request Headers, the following Headers also can be used
|x-amz-copy-source||Source Bucket and source Object name are separated by "/".
The character string must use URL encoding
|x-amz-storage-class||If there is no specified header, the default storage type is Standard storage.
Valid Values: STANDARD, GLACIER, REDUCED_REDUNDANCY, STANDARD_IA
No Request Elements
Except public response Headers, the operation can also use the following Headers
|x-amz-storage-class||Provide storage type information of Object. In the case of non-standard storage, OSS will return the Header|
|CopyObjectResult||Response Element Information Set.
|ETag||Return ETag of new Object.
|LastModified||Return last modification time of the object.
PUT /my-second-image.jpg HTTP/1.1 Host: oss-example.s3.<region>.jdcloud-oss.com Date: Wed, 28 Oct 2009 22:32:00 GMT x-amz-copy-source: /bucket/my-image.jpg Authorization: <authorization string>
HTTP/1.1 200 OK x-amz-request-id: 318BC8BC148832E5 Date: Wed, 28 Oct 2009 22:32:00 GMT Connection: close Server: JDCloudOSS <CopyObjectResult> <LastModified>2009-10-28T22:32:00</LastModified> <ETag>"9b2cf535f27731c974343645a3985328"</ETag> </CopyObjectResult>