Force Download PDF Files
-
I have a few PDF files uploaded and when the link is clicked to download them they open in the window. I the files to force download, is there anyway to do this in WordPress?
I’ve tried multiple download button plugins to achieve this, but can’t seem to find the right one. If it has a “force download” feature, then I can’t get the button to look right (matching with my site). If I can get the button to look right (match my site) then it doesn’t have a “force download” feature.
There has to be a way to do this in WordPress. Maybe a way to append the URL or something? It looks like someone asked perhaps the same question as me a few years back, but the link to access that forum is dead… so that was no help.
The blog I need help with is: (visible only to logged in users)
-
This is actually controlled by your browser settings and is not controlled by the WP software.
While you can change the settings in your own browser to force PDFs to download, this will not affect users who visit your website.
Any browser that utilizes a built-in PDF viewer, will attempt to open any PDF documents directly in the browser for viewing purposes. This is the default setting in Firefox, Chrome, and Edge.
-
It can be successfully controlled by plugins, or html, so it really should be a feature in WordPress as a simple tick-box when you “Edit more details” for any uploaded media file (PDF in this case).
I can append the dropbox URL and force a download with no problem, but I don’t like that it takes you to a blank page first to begin that download (hence the reason I’d like to keep it all in WordPress).
The “Easy Media Download” and “Quick Download Button” plugins both have a force download feature, and it works well – you click the link and the file downloads, it’s that simple and clean. Unfortunately, those plugins are limited and I can’t get them to look the way I need them to look.
The “Button Generator Pro” plugin is beautiful and I can get it to look exactly the way I want, they just don’t have the force download feature. So, it’s 100% possible to force a download despite browser settings, I just can’t find the right combination of plugins to work.
-
In that case, I would suggest contacting the developers of Easy Media Download and Quick Download Button.
They may be able to provide an avenue for altering the appearance of the plugin to suit your needs.
-
Personally I wouldn’t want to visit a site where files were forced downloaded to my PC. I’d feel safer choosing what I download.
-
in addition to @themagicrobot, a site forcing an unwanted download will be quickly marked as a spam or malicious website. Also all antivirus will block forced downloads.
-
@staartmees @themagicrobot – It’s not an “unwanted” download. If they don’t want it, then they shouldn’t click the “download” button. In fact, @themagicrobot, you do choose to download what’s on my site (or not)—no one’s forcing you do anything. That’s the whole point—it’s supposed to download and NOT open in another window. Both of you trying to sound like you know what you’re talking about, but you haven’t got a clue. You’re obviously not be familiar with the term “force download”, it doesn’t have anything to do with being unwanted, it’s a specific action and correct verbiage for the code I need, the user expects a download but isn’t being fulfilled by code in this case. Issue is fixed now and the developer of the plugin I’m using has made the necessary updates.
- The topic ‘Force Download PDF Files’ is closed to new replies.