< Previous | Contents | Next >

Example 2: Storing an object with custom metadata and an ACL

Here’s a sample PUT request that stores an object named hum_res/budget_proposals/BudgProp-2013 in the finance bucket, for which versioning is disabled. The object is stored with custom metadata specified by three

x-amz-meta- headers and a canned ACL specified by the x-amz-acl header.

Request with s3curl command line

./s3curl.pl --id=lgreen --put=/hum_res/budget_proposals/BudgProp-2013 -- -k "https://finance.europe.hcp.example.com/hum_res/budget_proposals/ BudgProp-2013" -H "x-amz-meta-author:P.D. Grey"

-H "x-amz-meta-author:Morgan White" -H "x-amz-meta-auther:Paris Black"

-H "x-amz-acl:authenticated-read"

132 Chapter 6: Working with objects

Creating a folder

Request headers

PUT /hum_res/budget_proposals/BudgProp-2013 HTTP/1.1 Host: finance.europe.hcp.example.com

Date: Fri, 16 Nov 2012 23:29:17 +0000

Authorization: AWS bGdyZWVu:FiWxioJHDGMLyP0WkCuqUpRqr2w= x-amz-meta-author: P .D. Grey

x-amz-meta-author: Morgan White x-amz-meta-author: Paris Black

x-amz-acl: authenticated-read Content-Length: 881932

Response headers

HTTP/1.1 200 OK

Date: Fri, 16 Nov 2012 23:29:17 GMT Server: HCP V7.0.0.16

ETag: "76216527ff2f6219f7c29251a619c8db"

Content-Length: 0