If you are experiencing an error when trying to download a file, you need to check three things:
- Check your site’s PHP error log
You can contact your web hosting provider and ask them to send the error file log to you. Then, send the resulting information to us so we can investigate the issue further. You can use our contact form to reach out to us.
You can locate the error_log on your website’s FTP – I’ve compiled a list of the most popular WordPress hosting companies and linked them to their docs, where they explain how to locate the error_log file.
IONOS
HostGator
Bluehost
DreamHost
InMotion
GoDaddy
Hostwinds
InterServer
Namecheap
If you can’t find your web hosting provider from the list above, this tutorial will be helpful to you. - Check your browser’s console for a CORS error
CORS stands for “Cross-Origin Resource Sharing.” It is a security feature implemented by web browsers to prevent websites from requesting a domain different than the one that served the web page.
Imagine that you are on a website called “Website A,” and Website A wants to request data from a different website called “Website B.”
When Website A makes this request, we call this a “cross-origin” request because it requests data from a different domain.
Without CORS, Website B would not allow Website A to access its data because it does not trust Website A.
However, with CORS, Website B can specify which other websites (like Website A) can access its data. CORS is a security measure implemented by the browser to help keep your data safe and secure.
To check if there is a CORS error, you need to go to your download on your website and right-click from the browser window > Inspect > there should be a tab called “Console” or hit the F12 key of the keyboard should open developer tools; click it and check for any errors. Here is a short video with the steps to take.
If it’s a CORS error, you need to find out what domain the download originates from. It’s likely, the domain serving the download differs from the domain where the file is available as a download.
We also have a plugin called Download Monitor CORS that you can install and use to specify which domains can access your data.
To install it, you need to go to your WP dashboard > Plugins > Add new > search for Download Monitor CORS > Install and activate it.
If you need further instructions, here’s a short video with the steps you need to follow to install the plugin.
You need to install it on the site hosting the files you’re looking to serve and add the domain settings from which the download request originates.
For example, let’s say that the download files are on domain-x.com, and the presentation site is on domain-z.com.
In this case, you need to install our plugin on domain-x.com, and in the settings, you need to add domain-z.com.
You need to go to your WordPress dashboard > Downloads > Settings > Advanced > Access > CORS URL >. Specify the requester URL to allow cross-site download requests from the specified source; you must add * to accept all > Save changes. - Check if you have these terms in the htaccess: DEFLATE, COMPRESS, GZIP
You need to go to your WordPress dashboard > Plugins > Add new > search for the Htaccess File Editor plugin > Install and activate it.
Check the htaccess and check if you have any of these terms: DEFLATE, COMPRESS, GZIP.
Please see the following example:
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/html
text/plain
text/x-component
text/xml
</IfModule>