【发布时间】:2017-10-11 22:25:36
【问题描述】:
我正在使用 HTML5 下载属性来允许用户从 S3 下载视频文件:
<a href="https://mybucket.s3.amazonaws.com/video.mp4" download="video.mp4">Download</a>
这在 Chrome 和 IE 中完美运行。从以下问题中,我了解到 Firefox 希望启用 CORS 以允许下载属性跨源工作:
我已使用以下技术在我的 S3 存储桶上启用了 CORS:
http://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-cors-configuration.html
这是我的 CORS 政策:
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Firefox 仍然不想下载视频。任何帮助、提示或建议将不胜感激。谢谢。
【问题讨论】:
-
你得到什么错误?请分享屏幕截图或复制并粘贴这些错误。
-
当我使用 Firefox 点击下载链接时,mp4 视频会在新标签页中打开而不是下载。
标签: html amazon-web-services firefox amazon-s3