Amazon S3 - Forcing files to download
Sometimes your web browser will try to display or play whatever file you're downloading, and you might end up playing music or video inside your browser, instead of saving it. There are a variety of things that can be done to prevent this, and force the save option, but if you're storing your files on Amazon S3 then any settings on your web server are ignored.
Instead of relying on the settings of your web server you must set things properly in S3. Here's how they should be set.
Note: This settings is applied to a file and/or folder but not the whole bucket
- In your S3 Bucket find the file you wish to work with and select it.
- Click Actions > Change metadata.
- Click "Add Metadata" and set the "Key" to "Content-Disposition" and set the value to "attachment" and hit save.
This will force it to be downloaded instead of played or displayed in your browser.