enabling download for all documents for external users while public sharing.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
monicakumari
Established Member

enabling download for all documents for external users while public sharing.

Jump to solution

Hi All,

I need to enable the download button for all the documents instead of just image files while sharing for external users.

Currently it is enable for image file only. so I have replaced model.showDownload = "false" with model.showDownload = "true" in quickshare/node-header.get.js.

now it is enable for all types of documents but the download button is not working for external users. It is neccessary to login to download the documents. since external users dont have any access but I want them to be able to download the documents.

The quickshare/node-header.get.html.ftl file needs a "contentURL" for download option and its getting blank in case of no login. and due to this download button is not working.

I have tried by overriding download.get.desc.xml and changed <authentication>user</authentication> to <authentication>guest</authentication> but it didn't worked. I don't know am I on the correct way.

Is there any way I can do this. Basically I want to remove or bypass the authentication so that external users can download the documents.

Please guide me over this if anybody have any idea about it.

 

Thanks,

Monica

2 Solutions

Accepted Solutions
jpotts
Professional

Re: enabling download for all documents for external users while public sharing.

Jump to solution

The download button shows for any file type as long as the user has read access on the node. So there shouldn't be any customization necessary for that.

How do you want users to get to the documents? If quickshare works for you, what about writing a script that makes the document shared? You could trigger it from a rule, for example. Or, if you want to trigger it from a web script, see this thread.

If you want users to use regular Share to get to the documents, add the EVERYONE group as a Consumer to your site.

If neither of those options sound good, you could write a web script that runs as the administrator and streams the content. This option would completely by-pass security.

Similarly, you could write a small application which would use CMIS or the REST API to fetch the documents using a 'service account'. You would need to grant the service account read access to the folder(s) or content items you want to make available to the application. Your application can then either use its own authentication or no authentication at all. Your application is kind of like a proxy in this respect.

So there are a lot of ways to let users download content without authenticating. It just depends on exactly what you are trying to do.

Hope these ideas helped,

View solution in original post

monicakumari
Established Member

Re: enabling download for all documents for external users while public sharing.

Jump to solution

I have called the REST API..

alfresco/api/-default-/public/alfresco/versions/1/shared-links/${shareId}/content

for example, http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/shared-links/666BIWoXQSWGJEsusAVy-g/content and it worked.

 

Just replaced <a href="${url.context}/proxy/alfresco${(contentURL!"")?html}?a=true" tabindex="0">${msg("button.download")}</a>
with

<a href="${url.context?replace("/share", "/alfresco")}/api/-default-/public/alfresco/versions/1/shared-links/${shareId}/content" tabindex="0">${msg("button.download")}</a>

in quickshare/node-header.get.html.ftl and added model.shareId = shareId;  in quickshare/node-header.get.js.

 

and it worked.

 

Thanks for your help.

View solution in original post

2 Replies
jpotts
Professional

Re: enabling download for all documents for external users while public sharing.

Jump to solution

The download button shows for any file type as long as the user has read access on the node. So there shouldn't be any customization necessary for that.

How do you want users to get to the documents? If quickshare works for you, what about writing a script that makes the document shared? You could trigger it from a rule, for example. Or, if you want to trigger it from a web script, see this thread.

If you want users to use regular Share to get to the documents, add the EVERYONE group as a Consumer to your site.

If neither of those options sound good, you could write a web script that runs as the administrator and streams the content. This option would completely by-pass security.

Similarly, you could write a small application which would use CMIS or the REST API to fetch the documents using a 'service account'. You would need to grant the service account read access to the folder(s) or content items you want to make available to the application. Your application can then either use its own authentication or no authentication at all. Your application is kind of like a proxy in this respect.

So there are a lot of ways to let users download content without authenticating. It just depends on exactly what you are trying to do.

Hope these ideas helped,

View solution in original post

monicakumari
Established Member

Re: enabling download for all documents for external users while public sharing.

Jump to solution

I have called the REST API..

alfresco/api/-default-/public/alfresco/versions/1/shared-links/${shareId}/content

for example, http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/shared-links/666BIWoXQSWGJEsusAVy-g/content and it worked.

 

Just replaced <a href="${url.context}/proxy/alfresco${(contentURL!"")?html}?a=true" tabindex="0">${msg("button.download")}</a>
with

<a href="${url.context?replace("/share", "/alfresco")}/api/-default-/public/alfresco/versions/1/shared-links/${shareId}/content" tabindex="0">${msg("button.download")}</a>

in quickshare/node-header.get.html.ftl and added model.shareId = shareId;  in quickshare/node-header.get.js.

 

and it worked.

 

Thanks for your help.

View solution in original post