Forcing Download of a File in the Browser

Summary

Force a binary file (PDF, DOCX, etc) to be downloaded instead of being opened in the browser.

Body

Issue/Question

How can I force the browser to download a file that I put on a Web CMS page?

Resolution

Currently the WYSIWYG Editor strips that attribute out, however if you hold down the shift key and click on the green edit region button, it will take you to an inline editor. Within the editor, you will need to click on the Source Code < > button and add download="FILENAME.EXT" within the <a href=""> tag.

Example: <a href="{{f:XXXXXXX}}" title="sample pdf file">Sample PDF File</a> will turn into <a href="{{f:XXXXXX}}" title="sample pdf file" download="sample-pdf-file.pdf"> instead.

Details

Details

Article ID: 1424
Created
Thu 4/30/15 8:48 AM
Modified
Tue 11/12/24 2:23 PM