【发布时间】:2018-03-02 00:05:23
【问题描述】:
我有一个启用了“静态网站托管”的 S3 存储桶。如果我通过 AWS 控制台将 html 文件上传到存储桶,则 html 文件会成功打开。如果我使用 AWS CLI 上传文件,文件被下载而不是显示在浏览器中,为什么?
第一个文件在这里:https://s3.amazonaws.com/test-bucket-for-stackoverflow-post/page1.html
第二个文件在这里:https://s3.amazonaws.com/test-bucket-for-stackoverflow-post/page2.html
我在 AWS 控制台中上传了第一个文件,第二个文件是使用以下命令上传的:
aws s3api put-object --bucket test-bucket-for-stackoverflow-post --key page2.html --body page2.html
【问题讨论】: