cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Download Content

alfsender
Champ in-the-making
Champ in-the-making
Hi All,

I am working on downloading content from Alfresco. I know Alfresco has exposed webscripts to download content.
I have content url like http://localhost:8080/alfresco/d/a/workspace/SpacesStore/82fc955f-17b3-488b-84ec-3d14a8e3333e/Recurr..., but i want to hit this url from my java class using below code..

String DOWNLOAD_URL  = http://localhost:8080/alfresco/d/a/workspace/SpacesStore/82fc955f-17b3-488b-84ec-3d14a8e3333e/Recurr...;
HttpClient httpClient = new HttpClient();
GetMethod downloAdGetMethod = new GetMethod(DOWNLOAD_URL);
int responseCodeD = httpClient.executeMethod(downloAdGetMethod);

As I have <a:commandLink> onclick of this i am calling function which has above code. So onclick of that link a popup should come to download that content.

i need your valuable suggestion.

regards,
alfsender
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
We can't help you unless you tell us what is wrong or error messages you are seeing. Can you provide more detail? One thing I suspect you will run into is that the request requires authentication, so you will need to set auth headers to make that get call.

Also, have you considered using OpenCMIS to retrieve the content? Then you wouldn't have to deal with raw HTTP requests.

Jeff

alfsender
Champ in-the-making
Champ in-the-making
Hi jeff,

I will try you inputs in my work.

Thank you for your response ..