VPS business hosting starting at $29.95/24/7 premium technical support

S3 notes – how to make all s3 images public


aws configure --profile myproject
// to test if it works or not

aws s3 ls --profile myproject

aws s3 cp \
      --exclude "*" \
      --include "*.jpeg" \
      --content-type="image/jpeg"  \
      --metadata-directive="REPLACE" \
      --recursive \
	  --acl public-read \
       s3://myproject/ \
       s3://myproject/ \
	   --dryrun --profile myproject
aws s3 cp \
      --exclude "*" \
      --include "*.jpg" \
      --content-type="image/jpeg"  \
      --metadata-directive="REPLACE" \
      --recursive \
	  --acl public-read \
       s3://myproject/ \
       s3://myproject/ \
	   --dryrun --profile myproject
aws s3 cp \
      --exclude "*" \
      --include "*.jpeg" \
      --content-type="image/jpeg"  \
      --metadata-directive="REPLACE" \
      --recursive \
	  --acl public-read \
       s3://myproject/ \
       s3://myproject/ \
	   --dryrun --profile myproject
// not needed 
aws s3 sync . s3://my-bucket/path --acl public-read
	   

Dont forget to remove dryrun flag once you are sure.

Author: Harshvardhan Malpani

PHP Developer based in New Delhi, India. Working as a freelance web developer providing server deployment, website development and maintenance services.

Leave a Reply

Your email address will not be published. Required fields are marked *