amazon-s3

Access files stored on Amazon S3 through web browser


Current Situation

I have a project on GitHub that builds after every commit on Travis-CI. After each successful build Travis uploads the artifacts to an S3 bucket. Is there some way for me to easily let anyone access the files in the bucket? I know I could generate a read-only access key, but it'd be easier for the user to access the files through their web browser.

I have website hosting enabled with the root document of "." set.

Screenshot of website hosting setup

However, I still get an 403 Forbidden when trying to go to the bucket's endpoint.

403 Forbidden

The Question

How can I let users easily browse and download artifacts stored on Amazon S3 from their web browser? Preferably without a third-party client.


Solution

  • I found this related question: Directory Listing in S3 Static Website

    As it turns out, if you enable public read for the whole bucket, S3 can serve directory listings. Problem is they are in XML instead of HTML, so not very user-friendly.

    There are three ways you could go for generating listings: