I have a Templates document library, where the piece of code below has happily forcing the download of a template document instead of the file been opened. However, it has stopped working.
The reason for needing to force download is that users actually need a copy of the template and don't need to open the actual original template. (There is an approval workflow, as part of a QMS, which manages the templates and tracks the version, users accidentally interfere with this otherwise).
If any user clicks on a file name currently they see this error message (which isn't really telling us anything, other than the code is not rerouting the 'open file' request to a 'download document' request:
Here is the code that is being used:
n.b. there is a Templates Editors group for certain users who have permission to edit the templates in order to keep them updated. For everyone else -> force download.