简体   繁体   中英

Python - How to get the metadata dictionary of a public Amazon S3 file?

I am trying to get the metadata of a public Amazon S3 file in a public bucket. I have the URL of the file, the bucket name, the filename and even the metadata key ("x-amz-meta-description"). I'm trying to access the metadata for that file, and more specifically the value of that specific key. Is there a way to access that metadata without setting up a full private connection to that bucket?

It looks like you should be able to do this with a HTTP HEAD request to the object. The Amazon API docs indicate that this should return all the metadata entries as x-amz-meta-* headers.

Does this help you, or is there a specific library you're using that you need this information from?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM