cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove the download function from preview when the document can not be previewed

henrychoi_yw
Champ in-the-making
Champ in-the-making
Is there any way to remove of disable the download function in preview when the document can not be preview?
e.g. Docx file can not be preview and it asks the user to download it instead.

Just want to remove that line of download option.
2 REPLIES 2

deepak1987
Star Contributor
Star Contributor
Hi,

To achieve this, you need to make a change in following files:

1) <strong>ALFRESCO_HOME</strong>/tomcat/webapps/<strong>share</strong>/components/preview/<strong>web-preview.js</strong> & <strong>ALFRESCO_HOME</strong>/tomcat/webapps/<strong>share</strong>/components/preview/<strong>web-preview-min.js</strong> files.

<strong>
FROM:
</strong>
<javascript>



var message = this.msg("label.noPreview", this.getContentUrl(true));

</javascript>
<strong>
TO:
</strong>
<javascript>

var message = this.msg("label.noPreview");


</javascript>

2) Copy all files from <strong>ALFRESCO_HOME</strong>/tomcat/webapps/<strong>share</strong>/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/preview/<strong>web-preview.get_*.properties</strong> to

<strong>ALFRESCO_HOME</strong>/tomcat/<strong>shared</strong>/classes/alfresco/<strong>web-extension</strong>/site-webscripts/org/alfresco/components/preview/<strong>web-preview.get_*.properties</strong>


And change the value of property "label.noPreview". You need to remove &lt;a&gt; anchor tag after the message in all web-preview.get_*.properties files under /tomcat/shared/ location

<strong>
FROM:
</strong>

label.noPreview=This document can''t be previewed.<br/><a class="theme-color-1" href="{0}">Click here to download it.</a>


<strong>
TO:
</strong>

label.noPreview=This document can''t be previewed.


3) Restart the server.

Does this work on Alfresco 201704? I tried what you had said but still the Download link is appearing in the preview window