Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Images do not display on a static page hosted on AWS S3

In S3, I have an index.html, a CSS file and an images folder with 3 jpg files in it. I cut and pasted the jpgs into the S3 folder. They showed as being there. I set a display policy per the instructions to display to everyone. The page displayed, but the images did not. I get the alt text and the tooltips, but no images. On the page, when I right click the Open Image in New Tab, I get an Access Denied message in XML. The page is: http://s3.amazonaws.com/pittsfordcommunitycenter/index.html

Images display on my development PC. I've tried a lot of things in AWS, including what the documentation suggested. What do I need to change?

like image 407
Mike_Laird Avatar asked Aug 17 '16 19:08

Mike_Laird


1 Answers

This is your index.html URL:

http://s3.amazonaws.com/pittsfordcommunitycenter/index.html

This is your first image URL, which is missing the bucket name:

http://s3.amazonaws.com/images/WheelchairInElevator_w_475.jpg

The image URL should actually be:

http://s3.amazonaws.com/pittsfordcommunitycenter/images/WheelchairInElevator_w_475.jpg

Viewing your page source it looks like, given the location of your index.html file, all your image paths should start with ./images/ instead of ../images/. Since it works on your local machine I'm guessing your local index.html location is different, relative to the image files.

like image 136
Mark B Avatar answered Oct 27 '22 00:10

Mark B