I created a plugin to force files to download in PicoCMS.
I needed this because I wanted to PDFs to download and not just render in the browser.
Place your files in the content folder. Then replace the word
content/ in the url with the word
The download folder can be controlled in the plugin file. Default for downloading is
If you wanted to render the file in the browser:
Now with this plugin installed, you can force a download:
I have added quite a few comments in the plugin so just take a look. It’s nothing new, just bringing different snippets together.
You can find the project here on Github.