亚马逊AWS S3强制下载的MP3文件,而不是流它亚马逊、而不是、文件、AWS

2023-09-11 09:11:35 作者:Sadness ゛

我使用Amazon S3的把MP3文件,然后让我们的网站访客下载亚马逊AWS的MP3。我用S3Fox来管理文件,一切似乎都工作正常,直到最近,我们得到了来自顾客的抱怨是,MP3是通过浏览器,而不是显示浏览器保存对话框流。 我尝试了一些MP3,注意对一些MP3,保存对话框出现,而对于一些其他人,他们正在通过浏览器流。我能做些什么给力的MP3文件就会被下载,而不是通过Web浏览器流......

I'm using Amazon S3 to put the mp3 file then allow our site visitor to download the mp3 from Amazon AWS. I use S3Fox to manage the file, everything seems working fine until recently we got many complaints from visitor that the mp3 was streamed via the browser instead of displaying browser save dialog. I try for some mp3 and notice that for some mp3, the save dialog box is appear, and for some others they're streamed via browser. What can I do to force that the mp3 file will be downloaded instead of streamed via web browser....

任何帮助将是非常美联社preciated。 谢谢

Any help would be much appreciated. Thanks

推荐答案

在为了做到这一点,你需要设置Content-Disposition标头:

In order to do so you need to set the Content-Disposition header:

Content-disposition: attachment; filename=song.mp3

我不认为这是可能的S3Fox。你可以使用Bucket资源管理器(不是免费的)或写上载文件的脚本。

I don't think this is possible with S3Fox. You could use Bucket Explorer (not free) or write a script to upload the files.