{"id":1238,"date":"2012-02-01T12:48:42","date_gmt":"2012-02-01T19:48:42","guid":{"rendered":"http:\/\/xiehang.com\/blog\/?p=1238"},"modified":"2012-02-01T12:48:42","modified_gmt":"2012-02-01T19:48:42","slug":"aws-s3-development-tips","status":"publish","type":"post","link":"https:\/\/xiehang.com\/blog\/2012\/02\/01\/aws-s3-development-tips\/","title":{"rendered":"aws s3 development tips"},"content":{"rendered":"

This may not be useful to others, but it bothered me quite some time, so I’d like to write it down in case some others stuck at the same place as I did.<\/p>\n

getMetadataForKey calls from aws-ios-sdk, actually it:<\/p>\n

    \n
  1. returns user defined meta data, nothing to do with s3’s meta data<\/li>\n
  2. the key used here will be prepended a “x-aws-meta-“, that is, in aws console, we will see a meta data entry keyed with “x-aws-meta-hahaha”, but in ios app you need to use “hahaha” to get the value<\/li>\n<\/ol>\n

    some other interesting stuffs … don’t use S3GetObjectRequest\/Response call to get object’s header information, as it will indeed download the object. Instead, you should use S3GetObjectMetadataRequest\/Response.<\/p>\n

    To get “Expiry Date” and \u00a0“Lifecycle Rule” information as they are shown on aws console, you need to use response”s\u00a0valueForHTTPHeaderField method with key “x-amz-expiration”, the parse it … I guess there should be something more easier but havenn’t figured out how. Both “expiry-date” and “rule-id” are there so you can use them, note that they can be empty so better prepare for that.<\/p>\n","protected":false},"excerpt":{"rendered":"

    This may not be useful to others, but it bothered me quite some time, so I’d like to write it down in case some others stuck at the same place as I did. getMetadataForKey calls from aws-ios-sdk, actually it: returns user defined meta data, nothing to do with s3’s meta data the key used here […]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[256,252,258,280],"_links":{"self":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1238"}],"collection":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/comments?post=1238"}],"version-history":[{"count":1,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1238\/revisions"}],"predecessor-version":[{"id":1240,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1238\/revisions\/1240"}],"wp:attachment":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/media?parent=1238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/categories?post=1238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/tags?post=1238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}