简体   繁体   English

如何在angularjs和codeigniter中下载Amazon S3文件(音频/视频)?

[英]How to download amazon s3 file(audio/video) in angularjs and codeigniter?

I have amazon S3 link like, 我有亚马逊S3链接,

http://mytest.s3.amazonaws.com/audio/3/1431428586_z3PtL.mp3 http://mytest.s3.amazonaws.com/audio/3/1431428586_z3PtL.mp3

I want to downaload this mp3 file. 我想下载这个mp3文件。 I tried a lot, but failed! 我尝试了很多,但是失败了!

So Please help! 所以请帮忙!

In order force download a file in an S3 bucket, you will need to set a Request Header. 为了强制将文件下载到S3存储桶中,您需要设置请求标头。 The specific request header to set is Content-Disposition: attachment . 要设置的特定请求标头是Content-Disposition:attachment

You can set the header when you upload the file via the AWS REST API. 通过AWS REST API上传文件时,可以设置标头。 As described in the AWS Documentation . AWS文档中所述

Or, you can set it manually in the file properties metadata in the AWS Console view example . 或者,您可以在AWS Console 视图示例的文件属性元数据中手动设置它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM