PUT Object - Copy
- Description: create an object by copying (copy another file in the system instead of uploading specific file content).
- Request format::
PUT /<ObjectName> HTTP/1.1
Host: <Your-Bucket-Name>.ss.bscstorage.com
Date: <date>
x-amz-copy-source: </source-bucket/source-object>
Authorization: <authorization string> #Please refer to signature algorithm
- response:
HTTP/1.1 200 OK
Date: Tue, 08 Apr 2014 02:59:47 GMT
Connection: keep-alive
ETag: "<MD5 value of file>"
x-amz-request-id: 0000106c-1608-0810-4621-00163e000064
x-amz-s2-requester: <Your UserName>
<?xml version="1.0" encoding="UTF-8"?>
<CopyObjectResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<LastModified>Mon, 08 Aug 2016 05:04:10 GMT</LastModified>
<ETag>870c06c00566c4fb1861bb10f34d1904</ETag>
</CopyObjectResult>
Request Headers:
Name Description Required x-amz-copy-source The address of the file to be copied. Format: / source bucket / source object. urlencode the whole. Yes Cache-Control File cache, standard HTTP protocol. For more information, see:http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 No Expires The cache expiration time of the file in the client or browser allows the client not to check the server before this time, and the original value is returned when reading. Format is:Sun, 29 Jul 2018 20:36:14 UTC No Content-Type File mime type. The original value is returned when reading No Content-Length must be 0 =0 Content-Disposition HTTP standard file attribute information. The original value is returned when reading. See:http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1 No Content-Encoding File code, HTTP standard file attribute information, and the original value is returned when reading. See:http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11 No x-amz-acl File ACL: set an ACL while creating a file. Please refer to 《ACL》 No x-amz-meta-* User defined metadeta. The header starts with x-amz-meta -, and all meta are stored in the form of key: value. The maximum limit is 64KB. It is returned as it is when HEAD or GET No x-amz-copy-source-if-match If the specified Etag matches the Etag of the source file, the source file can be copied, otherwise 412 is returned(PreconditionFailed) No x-amz-copy-source-if-nonematch If the specified Etag does not match the Etag of the source file, the source file can be copied, otherwise 412 is returned(PreconditionFailed) No x-amz-copy-source-if-unmodified-since If the source file has not been modified since the specified time, you can copy the source file; otherwise, return412(PreconditionFailed) No x-amz-copy-source-if-modified-since If the source file has been modified since the specified time, you can copy the source file, otherwise return412(PreconditionFailed) No Response Body(Response XML Body):
Name Description CopyObjectResult Contains Etag and LastModified elements ETag File's ETag CopyObjectResult Last modification time of the file
Request example: ``` curl -v -X PUT -H "x-amz-copy-source: /bucket-123/path/to/file123.txt" -H "Date:
Sat, 20 Nov 2286 17:46:39 GMT" -H "Authorization: AWS