How to update content-type of files on aws s3 in batch¶
Please install and config aws CLI first. The tutorial is at https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
Assume that the files you want to update are at s3://foo/bar/txt/
and your target conent-type is text/plain
, run the following command:
aws s3 cp \
s3://foo/bar/txt/ \
s3://foo/bar/txt/ \
--no-guess-mime-type \
--content-type="text/plain" \
--metadata-directive="REPLACE" \
--recursive
This article is originally created by tooli.top. Please indicate the source when reprinting : https://www.tooli.top/posts/aws_content_type
Posted on 2022-03-25
Mail to author