cancel
Showing results for 
Search instead for 
Did you mean: 

Access share Download URL from external Application ???

nirvanvjain
Champ on-the-rise
Champ on-the-rise
Hi Folks,

There is document download URL available in Share which allows you to download document directly if you are authenticated/logged in user.

I have requirement in which external JAVA application wants to download a document from outside. Now this share download URL is not a webscript so that I can pass my alfresco ticket and get the document from the repository.

Does share download URL makes a call to repository webscript to download document?
If yes, which is that data webscript?
If no, is there any mechanism/webscript available in repository which allows me to download the document directly?

Thanks!
1 REPLY 1

zladuric
Champ on-the-rise
Champ on-the-rise
From what I know, you could try accessing the download content directly? Something like /alfresco/api/node/${nodeRef?replace('://','/')}/content". Then make a copy of such webscript to

Make a copy of that webscript, make it runas="admin" so that you can access any content regardless of privileges, and DON'T make it a guest webscript (or else everybody could access it and the whole repository).

Now have your Java app make an auth first with your application to get the login ticket, and then use this copy of the access webscript.

Alternatively, do this on the Share side: make your Java app call "/share/page/dologin" POST call, with the username=$username, password=$password, success=$yourContentLink, failure=$failureLink as the POST payload. This will authenticate your application (you get the session and all) but it will not give you a ticket back - it will redirect you to the link you put in $yourContentLink. (which could be the share download link).

That is off the top of my head. Probably not a good way though, wait for somebody smarter to answer Smiley Happy