How to change content type of Amazon S3 Objects

后端 未结 3 749
情书的邮戳
情书的邮戳 2020-12-06 05:06

The objects in my Amazon S3 bucket are all of the content type application/octet-stream. Some of these objects are PDFs, sometimes images like JPG,

3条回答
  •  没有蜡笔的小新
    2020-12-06 06:05

    This is how you can set Content-Type for all files of type *.png

    aws s3 cp \
           s3://BUCKET-NAME/ \
           s3://BUCKET-NAME/ \
           --exclude '*' \
           --include '*.png' \
           --no-guess-mime-type \
           --content-type="image/png" \
           --metadata-directive="REPLACE" \
           --recursive
    

提交回复
热议问题