How do I show an image from my Amazon S3 on my website?

前端 未结 3 1739
孤独总比滥情好
孤独总比滥情好 2020-12-30 12:21

I have my pictures on Amazon S3. The pictures are private and not public so I can not show them with a direct link s3.amazonaws/bucket_name/key_name/image_name.jpg

3条回答
  •  伪装坚强ぢ
    2020-12-30 12:52

    Easiest thing to do is make them public in s3, at least read-only.

    If you don't want them to be public on s3, for whatever reason, you could add a cloudfront distribution that will serve the images from your s3 bucket, and you can give cloudfront access to the files, without making the images public in s3.

    This link shows you how to do that:

    http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html

提交回复
热议问题