简体   繁体   English

Python-如何获取公共Amazon S3文件的元数据字典?

[英]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. 我正在尝试在公共存储桶中获取公共Amazon S3文件的元数据。 I have the URL of the file, the bucket name, the filename and even the metadata key ("x-amz-meta-description"). 我有文件的URL,存储桶名称,文件名,甚至还有元数据键(“ 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. 看起来您应该能够通过对对象的HTTP HEAD请求来执行此操作。 The Amazon API docs indicate that this should return all the metadata entries as x-amz-meta-* headers. Amazon API文档指示这应返回所有元数据条目作为x-amz-meta-*标头。

Does this help you, or is there a specific library you're using that you need this information from? 这对您有帮助吗?或者您正在使用的特定库需要您提供此信息?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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