How to upload S3 metadata with a file in Fog?

眉间皱痕 提交于 2019-12-06 13:30:17

According to Programming Amazon Web Services by James Murty (O'Reilly), page 74:

S3 does not allow you to set arbitrary metadata items to be returned as HTTP headers; only some header names are recognized as legal HTTP headers. Any header with a name the service does not recognize is discarded.

According to the properties panel of the Amazon S3 console, only these metadata fields are allowed:

  • Cache-Control
  • Content-Disposition
  • Content-Type
  • Content-Language
  • Expires
  • Content-Encoding
  • x-amz-meta-

So, if you want to use custom metadata, make sure you use a key name that starts with x-amz-meta-. That would be x-amz-meta-custom for example above.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!