AWS S3复制/粘贴不会复制元数据 [英] AWS S3 copy/paste does not copy metadata

查看:184
本文介绍了AWS S3复制/粘贴不会复制元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Amazon Web界面,可以将S3对象从一个存储桶复制到另一个存储桶.

Using the Amazon web interface, it is possible to copy an S3 object from one bucket to another.

但是,粘贴的对象没有原始对象的元数据.如何同时粘贴元数据?

However, the pasted object does not have the metadata of the original. How can the metadata be pasted at the same time?

我猜想CLI可以做到,但是我不知道怎么做.

I'm guessing that the CLI can do it, but I can't figure out how.

注意,元数据必须与对象一起创建,以便在S3 PUT上触发的lambda函数中可用.

Note, the metadata must be created with the object so it is available in the lambda function triggered on the S3 PUT.

推荐答案

所以我想出了如何通过CLI做到这一点.

So I have figured out how to do it via the CLI.

aws s3 cp s3://<source bucket>/<filename> s3://<destination bucket>

文档状态

-元数据指令(字符串)指定是从源对象复制元数据还是用复制S3对象时提供的元数据替换元数据. ...有效值为COPY和REPLACE.如果未指定此参数,则默认情况下将使用 COPY .

--metadata-directive (string) Specifies whether the metadata is copied from the source object or replaced with metadata provided when copying S3 objects. ... Valid values are COPY and REPLACE. If this parameter is not specified, COPY will be used by default.

(我的重点.)

真的很容易.很奇怪,Web界面没有做到这一点.

All quite easy really. Very strange that the web interface does not do the same.

这篇关于AWS S3复制/粘贴不会复制元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆