How to get the metadata of an AWS S3 object?
Posted on In QAI upload files using the aws cli http://www.systutorials.com/239665/uploading-large-files-amazon-s3-aws-cli/ . But how to get the metadata of an object in AWS S3?
You can use the s3api
‘s head-object
command to get the metadata of an object.
Taking one example:
$ aws s3api head-object
--bucket test-hkust
--key dir2/fileupload/fb0c6353-a90c-4522-9355-7cd16cf756ff.file.txt
It will print results like
{
"AcceptRanges": "bytes",
"ContentType": "binary/octet-stream",
"LastModified": "Sun, 24 Apr 2016 15:20:34 GMT",
"ContentLength": 1560048,
"ETag": ""7d67f2ca5ee7c75a642d22065542e447"",
"Metadata": {}
}