DEV Community

[Comment from a deleted post]
Collapse
 
dazuaz profile image
dazuaz • Edited

For me, it did replace the content type from image/jpeg to binary/octet-stream, since I only had jpeg images I was able to just add that to the command.

It also changed the permission of the object, so I had to recreate the object acl

# List current object acl
aws s3api get-object-acl --bucket bucket-name --key object-key

# full copy command
aws s3 cp s3://bucket-name s3://bucket-name --metadata-directive REPLACE --recursive --cache-control max-age=2592000 --content-type image/jpeg --acl public-read

Useful info on acl
docs.aws.amazon.com/AmazonS3/lates...