Search code examples
htmlamazon-web-serviceswebamazon-s3svg

SVG images are not loaded on the page


I have a website hosted on Amazon S3 (static website hosting). All other features are working but weirdly, SVG images are not loading. Images are located in the sub directory of the site and path is correctly used. Please help me how to fix this issue.


Solution

  • Please go to the S3 bucket where your website is hosted and select the svg file that you are having problem with. Go to Properties > Metadata, you will see its content-type is set to different value than image/svg+xml (octet-stream now) Change it to image/svg+xml and reload the page.