Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon AWS S3 to Force Download Mp3 File instead of Stream It

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....

Any help would be much appreciated. Thanks

like image 794
Calua Avatar asked May 19 '10 10:05

Calua


1 Answers

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

Content-disposition: attachment; filename=song.mp3

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

like image 88
kgiannakakis Avatar answered Sep 24 '22 20:09

kgiannakakis