It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

attachment download disable

jerry zhang Oct 25, 2011

I want to disable the funcion of attachment download, and i find the method in document:http://confluence.atlassian.com/display/DOC/Disabling+Attachment+Downloads, but it tell me: These customisations will disable attachment downloads for all users, including administrators.

This is not good, i hope the uploader of this document and admin can download it but others can't, so how can I get it?

Pls help me, thanks very much!

2 answers

1 accepted

2 votes
Answer accepted

Hey Jerry, I believe you could add this to the actual customizations it would allow you to filter by group that the user that is currently viewing the page belongs to.

#set ($groups = $userAccessor.getGroupNames($action.remoteUser))

And then you can use the $groups to check what groups specifically this user is, with :

#if ($groups.contains("confluence-administrators"))

This will check if the user belongs to the confluence-administrators group, and then allow the user to download it.

Overall would be something like this:

#set ($groups = $userAccessor.getGroupNames($action.remoteUser))

#if ($groups.contains("confluence-administrators"))
Show Attachments
#else
Custom Message
#end

Hope this helps! Cheers

jerry zhang Mar 26, 2013

thanks very much, I will try it

Alexander Afonyashin Jul 10, 2013

Thanks, it works. But only for Browse->Attachments. Files are still accessible from the pages and Tools->Attachments. What templates should be modified to disable this?

Thanks,

Alexander

Darren Pegg Jan 26, 2017

Hey guys,

Is this done via a user macro?

3 votes
Rodrigo Adami Atlassian Team Mar 23, 2013

Hi Jerry,

I've tried to find another workaround for it and found this improvement: https://jira.atlassian.com/browse/CONF-19182

Unfortunately it was closed as won't fix because we don't have an estimated time to implement that feature.

As the only workaround I can see, is to disable the downloads for all users and if you need to grab the file, then you can go through the attachments folder in Confluence home directory and grab the file manually there. To find the file, you'll need to go through some folders. This can be explained by this documentation: https://confluence.atlassian.com/display/DOC/Hierarchical+File+System+Attachment+Storage

I hope this helps or at least mitigates the issue.

Regards,

Rodrigo

jerry zhang Mar 26, 2013

thanks for you help!

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

948 views 0 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you