亚马逊S3是不正确的文件服务 [英] Amazon S3 is not serving files correctly

查看:146
本文介绍了亚马逊S3是不正确的文件服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了这个网站我的朋友和我上传到亚马逊的S3存储(<一href="http://ballard26.s3.amazonaws.com/index.html">http://ballard26.s3.amazonaws.com/index.html)当我去到该网站上的网页无法正确加载,我也不知道为什么。任何想法?

I made this site for my friend and I uploaded it to an Amazon S3 bucket (http://ballard26.s3.amazonaws.com/index.html) and when I go to that site the page doesn't load correctly and I have no idea why. Any ideas?

例如, stylesheet.css中不正确加载。如果你去<一href="http://ballard26.s3.amazonaws.com/stylesheet.css">http://ballard26.s3.amazonaws.com/stylesheet.css,它下载而不是加载它作为CSS文件。

For example, the stylesheet.css doesn't load correctly. If you go to http://ballard26.s3.amazonaws.com/stylesheet.css, it downloads the file instead of loading it as CSS.

推荐答案

检查MIME类型(HTTP内容类型标头)你上传的文件。 S3并不总是正确的设置。您可能需要设置它们上传API调用。一些上传库会为你做这个。

Check the mime types (HTTP content type header) on the files you uploaded. S3 does not always set them correctly. You may need to set them on the upload API call. Some upload libraries will do this for you.

如果当该文件是从S3浏览器如果MIME类型不正确设置它不会总是正确地呈现下载的MIME类型是不正确的。

If the mime types are not correct when the file is downloaded from the browser from S3 if the mime type is not set correctly it will not always render correctly.

这篇关于亚马逊S3是不正确的文件服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆