cancel
Showing results for 
Search instead for 
Did you mean: 

how to disable download document action on alfresco 5.0D

agung_tarecha
Champ in-the-making
Champ in-the-making
how to disable download document action on alfresco 5.0D community edition?

I have try tutorial for alfresco 4 but nothing happen. I still can download document
1 ACCEPTED ANSWER

hardik1512
Star Contributor
Star Contributor
Hello,

I don't know any configuration for this but it can be done by overriding pdfjs.get.js file.
Here are the steps you can follow if you are using alfresco 5.0
1) Copy attached pdf-extension.xml file at tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension\site-data\extensions folder under your Alfresco. 
2) Copy attached pdfjs.get.js file at tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension\site-webscripts\custom\pdf folder under your Alfresco.
3) Restart Alfresco.

This should disable download button which you show in your attachment.

Hope this helps.

View answer in original post

26 REPLIES 26

hardik1512
Star Contributor
Star Contributor
Hello,

Add the below config entry in share-config-custom.xml file.
evaluator.doclib.action.disableAction is a OOTB evaluators which disables the action.

<config evaluator="string-compare" condition="DocLibActions">
   <actions>
      <action id="document-download" type="link" label="actions.document.download">
         <param name="href">{downloadUrl}</param>
         <evaluator>evaluator.doclib.action.disableAction</evaluator >
      </action>
   </actions>
</config>

Hope this helps.

mcavila
Champ in-the-making
Champ in-the-making
Hello Hardik
I added the entry in the share- config- file custom.xml but it worked .
The download buttons function normally. I restarted the Alfresco server but not anymore.
Please find attached my file changed . You could see if this right?
Is there other changes to make ?
Thank you so far.
And our agung.tarecha friend managed to make the changes ?

Hello,

This configuration is to disable download under Document actions(actions in right side when you open document) and not for what you mentioned in image.

hi hardik,

How should I disable download button property in Alfresco 5.2.0 of 201701 version.

<evaluator negate="false">evaluator.doclib.action.isSiteManager</evaluator>

is that code works to disable download for pdf and original file?

mcavila
Champ in-the-making
Champ in-the-making
Ok Hardik !
I understood , but in my case , you know how disallow the download button , like the image I sent attached ?
Would you help me?
I thank you so far …

hardik1512
Star Contributor
Star Contributor
Hello,

I don't know any configuration for this but it can be done by overriding pdfjs.get.js file.
Here are the steps you can follow if you are using alfresco 5.0
1) Copy attached pdf-extension.xml file at tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension\site-data\extensions folder under your Alfresco. 
2) Copy attached pdfjs.get.js file at tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension\site-webscripts\custom\pdf folder under your Alfresco.
3) Restart Alfresco.

This should disable download button which you show in your attachment.

Hope this helps.

mcavila
Champ in-the-making
Champ in-the-making
Thank you for the commitment to help.
I did as you taught, but it worked.
In my Alfresco there is only the path tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension\ , but I created the folders identical to what you said and copied the files inside.
I should copy the files in another directory?
What do you think happened?

Have you removed the txt extension from files?  That was just because forum was not allowing other files to upload.

The files name should be pdf-extension.xml and pdfjs.get.js   No underscores.