Why Force a File to Download?
Forcing a file to download ensures that the file is stored in the visitors computer. While some browsers automatically force a file to download, others will display the item (if the browser can read that particular file) and allow the user to decide whether the item is saved to the computer or not. Depending on the file type you are offering and the type of visitors you foresee downloading, you may choose to force the download or you may not.
Websites that offer larger files such as PDF’s often choose to force the download. This prevents the PDF file from opening up in the visitors browser. If a user clicks to download a PDF file they may wish to read it later on so saving the file directly to their computer makes sense. Websites that have an older user base may also force the files to download.
If you have set up a website where the visitors are paying to download the item, the best practice is to use a force file download feature. This ensures that the customer receives what they have purchased and also saves the administrators the time of manually needing to give the customer the downloadable item.
The bottom line is, in some cases it is more appropriate to force a file to download.
How Can I Ensure the File Begins to Download Automatically?
If you are using the Simple Download Monitor and Manager plugin, the good news is forcing a file to download automatically is simple to configure, allowing even those without developer knowledge the ability to set it up.
Forcing a File to Download Using the free PHP Dispatch Option
Within the ‘Edit Download‘ page of each item configured, you may or may not have noticed a checkbox to enable ‘PHP Dispatch‘. Marking this option generally works on most servers to force that file to download.
- Click on the ‘Downloads‘ menu and then click the ‘Edit‘ button for the download that you wish to trigger the force download.
- Scroll down until you notice the section titled ‘PHP Dispatch or Redirect‘ section.
- Mark the checkbox to enable PHP Dispatch.
- Click the ‘Update‘ button.
- Head to the front end of your website and try to download the item. Note whether or not the item is forced to download.
Using the Secure and Hidden Downloads Addon to Force a File
If you find that enabling the ‘PHP Dispatch‘ option isn’t successful, using the ‘Secure and Hidden Downloads Addon‘ will not only allow you to force a download, but will also allow you to hide the actual location of your files.
- Install and activate the ‘Hidden/Private/Secure Downloads Addon‘ for SDM.
- Once this addon is activated, ensure you have the ‘PHP Dispatch‘ option enabled as mentioned above for files that you wish to download automatically.
- Your files should now be forced to download once a visitor clicks on the download now button.