In my case, ‘Key’ was by default set to ‘Content-Type’ and ‘Value’ was set to ‘application/octet-stream.’ I left that as-is. In the S3 console, select an object (in my case, an audio file), and then click the ‘properties’ button (if the properties window at the bottom isn’t already visible). Yes – you’re exactly right, wzp! Thank you! I figured out what to add based on option 3 above.įor other newbies who have this issue, here’s the workflow: You will need to set them when uploading the files to S3. Set these: Content-Disposition: attachment filename=FILENAME.EXT Set the correct headers on your files in Amazon S3 in order to force the browser to download rather than opening the file. If you are storing your files to your amazon S3 account (instead of your server) then do the following to force a download on those files. You can change “pdf” to any other file type based on your need (example: mp3, mp4, doc).įorce File to Download from Your Amazon S3 Account Header set Content-Disposition attachment
htaccess file of your server to force a download of a particular file type from your server (in this example it is for PDF file types):
Option 3: You can add the following lines of code in your. You can instruct your users to use this option if you think it will help them (again this is common knowledge and most internet users know this). Option 2: Most browsers have a settings where it lets the users specify if they want to force download a certain type of files (for example: a pdf file). Most computer users know to unzip the file and get the content from inside.
Browsers cannot read zip file so it will force a download.
Option 1: The easiest solution is to put your file (example: a PDF file, a movie file) inside a zip file if possible (If you are using the PDF Stamper plugin then you can’t do this unfortunately). There are a few things you can do to ensure that. Some users prefer that all the files should be forced downloaded (no showing in the browser).
How to Force a File Download For All My Files Usually this is not an issue since the users can save the file to their computer after it is shown in the browser. If the browser cannot read a file type it will force a download to the hard disk. If a browser can read the file type it will show it in the browser. The key thing to understand is that some browsers maybe able to read a particular file type based on the addons you have installed for that browser while others may not be able to. Google Chrome has its own PDF converter and it will try to convert a PDF file and render it in the browser. For example, Internet Explorer (IE) will usually try to show Microsoft Word files (doc and docx) in the browser, while most other browsers will download it. Some file types show up in some browsers but not others depending on if the browser can read the file or not.
Download S3 (Credentials from AWS Security Token Service) connection profile for preconfigured settings.Usually when a user goes to a file URL (for example: a download link), the file will show in the browser if the browser supports it.Use Cyberduck for Windows or Cyberduck CLI on EC2 and have setup IAM Roles for Amazon EC2 to provide access to S3 from the EC2 instance. Download S3 (Credentials from Instance Metadata) connection profile for preconfigured settings.