How to modify Nextcloud to remove download/delete buttons

Hello Nextcloud forum,

I’m very intrigued by your new fork of ownCloud! I’ve been an ownCloud user for years now but in case I use ownCloud for a very specific purpose. I’ll explain…

In our office we put online (local lan only) all our Standard Operating Procedure documents (SOP’s) in PDF form. We don’t want our employees to download documents, the purpose of the SOP’s is to just read the documents on their workstations if need be. We ensure all our employees sign a confidentiality agreement, our workstations all run on a virtual machine so the thin client that they read the documents from do not have access to any downloaded documents so we’ve put some things in place to help us with people not accessing or copying downloaded material. Yes I know…all they need is a camera or cell phone and they can take a picture so no we don’t have a perfect system, but we have a system that has been working for us for many years. ownCloud displays within the the ownCloud PDF viewer our documents and we simply point ownCloud to a CIFS share so to update a document or add/remove a document is as simple as changing the PDF on the share (which only the owners have access to do this).

Where I’m looking for added value from Nextcloud hopefully is to be able to clean up the interface for displaying our SOP documents. I’ve been able to hack into the ownCloud code and remove some of the download buttons (like the big one at the top). But each individual document still has a download button beside it. I’ve never been able through the ownCloud forums or feature requests received help in removing this functionality from ownCloud. I really want to make our document viewer system more professional looking. It looks like Nextcloud is going to allow me to skin it with our company logo more easily. I would really like to be able to remove some of the functions (like download and delete buttons) entirely for this single purpose to only display documents for reading on the workstation.

Would someone be able to direct me in the right direction here on where I can find if this type of change (either by myself by looking in the code or making a request to Nextcloud) is a feature that can be done within Nextcloud? I know the whole purpose of Nextcloud, just like ownCloud, is a document sharing repo so removing the download or delete buttons is counter intuitive to what these systems are built for…but as a system whereby a company can ‘serve up’ documents for viewing only, I think this would be a very good feature to add to Nextcloud.

I hoping someone can point me in the right direction here on how I can attain this function within Nextcloud.

Thank you.

For the delete button, just remove the delete permissions from the share. But download…

Because it is so good or because nobody has seriously tried?

I don’t know if you could create an app that can remove such options. That would be the best solution.

You can always do this manually but you have to do it again after each update. Firefox has the “inspect element”-tool that points you at the source-code of a specific element. For the download button this would be:

<a href="#" class="menuitem action action-download permanent" data-action="Download">
<span class="icon icon-download"></span>

Now you can search for that on github:
The first hit of✓&q=<span>Download<%2Fspan>
shows you a list-template. So you could comment this part. Not sure if this is sufficient. If you start to disable parts of the code, it can break at other points or create errors.


Thank you for these replies…very much appreciated!

I forgot that removing the sharing option will remove the delete button. Good point. I have that covered then. :slight_smile:

As for the download button…I agree that by creating my own app that could remove such buttons would be ideal. That way I could upgrade Nextcloud to new versions more easily. Any code changes that needed to be done within my app I could take care of after the upgrade. I’ve used the inspect element in firefox and Chromes Inspect as well but I never had much luck with finding all the download button code for ownCloud (I did find the big download button code and was able to replace it).

I will dig into this some more and see what I can find. Thanks again for you suggestions and the link to the code on github.

I’m looking forward to using Nextcloud more and more…

wow is good for our experience.

any one in here, can give better source to remove button download for nextcloud template?
i try in apps/files/templates/list.php , but source code nextcloud template is difference with github source✓&q=<span>Download<%2Fspan>