Search for answers:
The OptimizePress Support Site Has Moved: Click here to access the new Support site

How to Force file downloads when using file download elements on your site with OptimizePress.

For Files Hosted in your media library or on your server:

Have you ever tried linking to a "pdf" or "mp3" file in the files download element but then when you click on it it loads in the browser instead of downloading?

Here is a fix for this. You can add this to the bottom of your .htaccess file for your site (please note that you should take a backup of your .htaccess file before editing).

<FilesMatch "\.(?i:mp3)$">
ForceType application/octet-stream
Header set Content-Disposition attachment

<FilesMatch "\.(?i:pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment

Note: You can change "pdf" or "mp3" to other file extensions but do not use .php, .js, .css, or any other file extension used in the coding of your sites or you may break the ability for your site to function.

Note: If using the "Membership Files Download" Element in the live editor, OptimizeMember automatically handles this for you for most files, however if using the regular (non members) "Files Download" element, you may need to use this method above to force the downloads.


For Files Hosted on Amazon S3:

To force the download of files on Amazon S3, you'll need to login to your Amazon S3 console at and navigate to the files you wish to modify. Then follow these steps:

  1. Right click on the file you wish to set this up for and go to "properties"
  2. Click on "Metadata"
  3. Click on "Add More Metadata"
  4. For "Key" select "Content-Disposition"
  5. For "Value" select "Attachment"
  6. Click the blue "save" button in the bottom right corner.

You can do this for any number of files on your Amazon S3 account and this will force that file to download rather than loading in your browser. Note that zip files don't need this as those typically download automatically anyways.



Didn't find an answer to your question? Contact Our Support Team (Submit a ticket)
Was this article helpful?
0 out of 0 found this helpful


Other Help Categories:

Get Started Guide

Watch our Ultimate Getting Started guide video

Pre-Sales Questions

Ask questions before purchasing our products

Login Problems

If you're having issues logging into our members hub

Accounts & Billing

Update your billing, request a refund and other accounts help

API Key Issues

Get help with licensing your site and API key issues

Membership Help

Get help creating Membership portals and courses

LiveEditor Help

If you need help using or troubleshooting the LiveEditor


Find out about the many integrations possible with OptimizePress

Affiliate Questions

Have questions about promoting OptimizePress

Clubhouse Questions

Questions about our Clubhouse Membership Subscription