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
Name | Description | Must |
---|---|---|
x-amz-copy-source | Source Bucket and source Object name are separated by "/". Type: String Default: None The character string must use URL encoding |
Yes |
x-amz-storage-class | If there is no specified header, the default storage type is Standard storage. Type: Enum Default: STANDARD Valid Values: STANDARD, GLACIER, REDUCED_REDUNDANCY, STANDARD_IA |
No |
No Request Elements
Except public response Headers, the operation can also use the following Headers
Name | Description |
---|---|
x-amz-storage-class | Provide storage type information of Object. In the case of non-standard storage, OSS will return the Header |
Name | Description |
---|---|
CopyObjectResult | Response Element Information Set. Type: Container Ancestor: None |
ETag | Return ETag of new Object. Type: String Ancestor: CopyObjectResult |
LastModified | Return last modification time of the object. Type: String Ancestor: CopyObjectResult |
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>