node.jsangularamazon-web-servicesamazon-s3

How do you display an image from s3 on a website?


I am new to web development and to s3 and was wondering how I might be able to display an image thats inside my bucket, Im able to get a list of image and folder names inside the bucket but I want to find out how to display the images. Would I need to provide a URL for my image tag in html?


Solution

  • An image stored in Amazon S3 can be included in a web page by using a normal <img> tag.

    The URL to use is shown in the Amazon S3 console, but it would be something like:

    http://BUCKETNAME.s3-REGION.amazonaws.com/folder/image.jpg
    

    For example:

    http://my-images.s3-ap-southeast-2.amazonaws.com/logos/foo.jpg
    

    The object must be publicly accessible. This can be done in a few ways: