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

Calua picture Calua · May 19, 2010 · Viewed 13k times · Source

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

Answer

kgiannakakis picture kgiannakakis · May 19, 2010

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.