I 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?
我使用aws cli http://www.systutorials.com/239665/uploading-large-files-amazon-s3-aws-cli/上传文件 。 但是如何获取AWS S3中对象的元数据呢?
You can use the s3api
‘s head-object
command to get the metadata of an object.
您可以使用s3api
的head-object
命令来获取head-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": {}
}
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。
翻译自: https://www.systutorials.com/how-to-get-the-metadata-of-an-aws-s3-object/