Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable attachment downloads?

jinpao
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 7, 2019

Hi,

 

I would like to disable downloads for all attachments in Confluence server and have already followed the steps detailed here: https://confluence.atlassian.com/confkb/how-to-disable-attachment-downloads-215484007.html.  It is not ideal as even administrators and uploaders will not be able to download their own attachments but that's the only solution we've found.  However, we found out that users are still able to download files via the download button that's available when you preview a file.  I'm aware that it's possible to disable the preview function altogether, but we need it.

Is it possible to disable only the download button?  Will Confluence natively support attachment download controls in the future?

preview_download_button.png

3 answers

1 vote
Andy Guo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 10, 2019

after many attempts, I got a solution:

extract mediaviewer.all.js from confluence-previews-7.0.11.jar, then changed

var tpl = handlebars_1.compile('\n <a role="button"\n tabindex="55"\n href="#"\n aria-label="{{label}}"\n class="cp-control-panel-download cp-icon"\n target="_blank"\n download>\n <span class="tooltip tooltip-n">{{label}}</span>\n </a>\n');

to 

var tpl = handlebars_1.compile('');

 

finally, add mediaviewer.all.js into confluence-previews-7.0.11.jar 

 

hope can help you.

Damien Tan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 22, 2019

tested this method on Confluence 6.15.1, it worked :D

0 votes
Erica Brady
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 28, 2019

Is there a solution for this yet?

0 votes
Sreenivasaraju P
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2019

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events