How to download the file in the CQ5 | Community
Skip to main content
October 16, 2015
Solved

How to download the file in the CQ5

  • October 16, 2015
  • 13 replies
  • 5785 views

We need to download the all extension files like pdf | txt | word |html and son on but except image in the CQ5, then to translate these files in localhost. At last upload these files back to CQ5.

The question is how to know the files list path and how to get the files stored in the CQ5 to localhost or a specific server and how to upload the file to CQ5?

 

Awaiting for anyone suggestion, thanks in advance!  

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

To download files, (for example, DAM Assets), you use the QueryBuilder API. Here is a community article that talks about how to build a custom Sling Servlet that downloads DAM Assets. In this use case - the collection of DAM Assets retrieved using the QueryBuilder API is placed in a ZIP file and downloaded, as shown in this pic:

[img]downloadClient.png[/img]

To read this development article, see: http://helpx.adobe.com/experience-manager/using/downloading-dam-assets.html.

13 replies

October 16, 2015

Get it , thank you so much.

Lokesh_Shivalingaiah
Level 10
October 16, 2015

AssetDownloadService is a service. one of the way to get an instance using @reference

@Reference

AssetDownloadService  assetDownloadService;

and then you can use this variables to access its methods.

October 16, 2015

Thanks you so much, again: API "AssetDownloadService"  is this a webservice?  If false,  developers how to instance it?   

smacdonald2008
Level 10
October 16, 2015

"I am wondering if AEM exposes any webservice APIs (SOAP or REST way)"

You can write a custom Sling Servlet and then invoke that Sling Service using a Restful request. I wrote an article that shows this concept. However, instead of pulling files from AEM, I uploaded files using a Rest Request - the target was client libs.

See this article. It will give you an idea:

http://helpx.adobe.com/experience-manager/using/post_files.html


 

October 16, 2015

Hi Peter,

Actually I am working on a connector between AEM and a TMS(GlobalSight).I am intrested in the downloadable files(real file nodes) in "Digital Assets" of AEM.I need pull these file/folder structure outside AEM to form a tree, then user can decide which files to translate in GlobalSight. After translated, user will push the translated file back into a selected folder in "Digital Assets". This is what we are expecting to archive.

I am wondering if AEM exposes any webservice APIs (SOAP or REST way, methods like "login", "getFiles", "uploadFiles" etc.) for such case? If possible,I don't intend to do any development work that run in AEM as a bundle, this is because AEM servers are not in our control. Deploying our own bundle in client AEM servers is an extra work. All development should be in GlobalSight(login, get files from AEM, push file into AEM).

As I am new to AEM, even Sling etc, maybe you can offer a constructive suggestion about my business?

Thanks a lot,

York

Sham_HC
Level 10
October 16, 2015

YorkJin wrote...

hi sham,

now i can print these assets information contain NodeType&NodeName&NodePath and so on. But i want to know how to use JCR query API to download files? Could you possibly give a sample code snippet?

thank a lot.

 

You can use asset download service  http://dev.day.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/dam/api/jobs/AssetDownloadService.html

October 16, 2015
October 16, 2015

Hi Peter,

Many thanks for your answer. But i wondering how to get the file list path  since i want to download all files except image.

Looking forward to your reply.

 

thanks  a lot.

October 16, 2015

hi sham,

now i can print these assets information contain NodeType&NodeName&NodePath and so on. But i want to know how to use JCR query API to download files? Could you possibly give a sample code snippet?

thank a lot.

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

To download files, (for example, DAM Assets), you use the QueryBuilder API. Here is a community article that talks about how to build a custom Sling Servlet that downloads DAM Assets. In this use case - the collection of DAM Assets retrieved using the QueryBuilder API is placed in a ZIP file and downloaded, as shown in this pic:

[img]downloadClient.png[/img]

To read this development article, see: http://helpx.adobe.com/experience-manager/using/downloading-dam-assets.html.