App to remove download button for shared folder


I’m struggling on how to do this myself in that I want to create an app that will allow me to remove the download option from a shared folder. We have PDF documents which our employees read on their terminals. They have no need to download these files and the company owner wants to remove the download button for this folder. We use the desktop sync client to add remove files from this folder (select people with supervisor and above access update these PDF documents).

Has anyone found a solution or created an app that they are willing to share? Or perhaps provide some direction for me on how I can start this task myself?

Thank you.


dirty hack which I used:
have a look at the html code and look for its class.
then either modify the stylesheet (via a theme) and set this class to “display: none” or modify the template itself and delete the button from the php-source.

the second one is an ugly mod of the sourcecode which will be overwritten with every update and it will trigger the integrity-check-failed warning.

File Access Control ?

Not sure how this could work…I want some of my workstations (using a shared link that doesn’t require login) to be able to read the PDF docs in the folders…but not be able to download these PDF docs.

I’ve looked at File Access Control before but I can’t figure out how to limit downloading of a file…yet still allow users to read (view) the files?

Could using system tag work perhaps?

I know my opinion is probably very specific and not shared by the Nextcloud developers (would love to hear what @jospoortvliet feels about this though :slight_smile: ).

Nextcloud has already provided an Official App for document control called ‘Files Access Control’. This app allows file shares to have editing or deleting removed if so desired. So obviously Nextcloud wants users to have control over the files they share. But why then does Nextcloud allow a download of the file? What if the owner of the fileshare only wants people to read the file and not edit it or download it. As a document sharing repository giving full control over your documents (to edit and/or download it) is what people should have in my opinion.

I realize my use-case is specific in that I’m using my fileshare to allow our employees to easily read their procedures online without having to shuffle through paper that they might lose. And I do realize that my argument has holes big enough to drive a truck through (there is no way to completely stop people from downloading or taking the information from your shared data). For me it’s about perception and cleanliness of the Nextcloud GUI. In our case we tell our employees to not Download files because there is no need to download files. But why then do we have a big Download button at the top? It’s looks messy in my opinion.

I do hope my thoughts on document control with allowing or disallowing editing and downloading changes some minds at Nextcloud and the removal of the download option can be added to the ‘File Access Control’ App or at least to a new App giving this ability. I don’t believe removing the Download button goes against what Nextcloud offers…sharing files doesn’t necessarily always mean download files. Sharing files to only read online could be a way to use Nextcloud for some people if they had the option.

Just my two cents…thanks for listening!


Thanks for your input.

Could we hide the download button? Sure. Does it mean people can’t download the PDF? Of course not, they can simply grab the ‘magic’ url used by our PDF viewer or use 100 other tricks to get it.

So the reason we don’t currently offer DRM-ish features like “can’t copy” and “can’t print” and “can’t download” is because they are just creating a false sense of security. There is no technical way to offer ppl to VIEW something without letting them download it in the digital world - see how often the security of things like Netflix and others is broken. This is a hugely complicated thing to do, requiring super invasive technologies like special encryption chips and limits on what devices and operating systems can be used (certainly not open source tech!) and legal threats and pervasive surveillance and spying and at the end of it all, it STILL gets circumvented.

You realize all this, indeed. And yeah, a cleaner UI is useful for your specific use case. But I would think it is niche enough that this would be something to offer with a Nextcloud app - something that would be quite easy to write, actually. It is certainly not a feature common enough to clutter the default UI with, imho. Especially due to the ‘false sense of security’ issue that will certainly create a difficult conversation with our security team - they will certainly not like this at all, calling it fake security and all that.

Really appreciate you taking the time to provide comment @jospoortvliet. And I completely agree with you…I’m not trying to provide a way to secure data because as you’ve succinctly explained “it’s just not possible”. I had no intention of providing such security for our files, yet my description does go down that road and it really shouldn’t have. But for my usecase it really is just optics to not have the download button on some shared folders. Very niche indeed.

My struggle then is with finding where this big download button is and how I can create an App to remove it. How do i find all the places to have it removed and how do I apply the removal based on group and/or share? Or would it be better in my case to create a theme? Since I’m doing this by group or share I suppose an App is a better solution. I realize you are very busy but if you have suggestions on how I can easily write this in that where can I start to find code for at least the Big Download button so I can remove it in an App I would be greatly appreciative for the head start.

I’ve looked at this page - Is this a good starting place to do what I need?

Yeah, building the basics of an app is there.You can ask questions and tips in the developer category on these forums - I sadly am not very technical so I can’t really point you much further… @BernhardPosselt is quite the app master, he might be able to say some much smarter things about it :smiley:

Or @juliushaertl ?

1 Like

@greavette I can’t go to much into detail on how to implement without having a look into the code but I guess the easiest would be to register to the OCP\Share hook share_link_access and depending on that, load a separate css file that will just hide the button.

Those links might be helpful:

1 Like

Is there an app that makes this happen? I am desperate for a solution, eventhough it is a false sense of security.

1 Like

Me too! Is there really no solution? Can’t be…!?
@BernhardPosselt Please help us!

A dummy, who likes nextcloud very much, but can’t use it with this (shi**y) button, because every client is pushing it, thinking its just downloading the files in the current directory… (one client has usually more directories for different files)…