Expand my Community achievements bar.

SOLVED

Download all assets from a folder AEMaaCS

Avatar

Level 2

Hi Community Members,

 

I have to download all contents of an Asset folder in one go and it should not be in zip format. What would be the best way to do it?

 

Thanks a lot in advance!!

 

1 Accepted Solution

Avatar

Correct answer by
Level 1

@RO981 

There is no such OOTB feature available. Even the Assets API would download it in ZIP format.

 

There is a discussion on the same topic here, where you need to write a custom servlet, to achieve the usecase.

 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/downloading-adobe-experien...

 

Ideally, you will have to :

1. Query the Assets you want to download.

2. Iterate through result and trigger custom servlet for each iteration to download an asset at a time.

 

Or

Write a custom servlet to download assets in zip format, and then extract it into another folder, delete the base zip file. All in one go.

 

This is going to be a long process and performance intensive.

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @RO981,

There can be below options you may consider

  1. Adobe Experience Manager Assets HTTP API [0].
  2. You can look into building the CURL command for that process using the article at [1].

If you are referring to Asset/PDF then that's how the download for Asset/PDF works because when a Asset/PDF is uploaded all it's contents are extracted as sub-assets. This behaviour can be changed via modifying the Asset/PDF extraction logic but it won't affect the download behaviour.

The logic behind this is that when an artefact is uploaded in AEM it becomes a DAM asset and rules governing to it's manipulation take over. For example, in case of PDF, a PDF asset is a collection of the original PDF and all it's images and thumbnail extractions. So when you are downloading something you are basically downloading the whole collection as AEM sees it.

Having said that, you can probably write a custom servlet and extend the DAM GUI to download just the Asset.

[0]: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/mac-ap...

[1]: https://experienceleague.adobe.com/docs/experience-manager-64/administering/operations/curl.html?lan...

Hope that helps!

Regards,

Santosh

Avatar

Level 2

Hi @SantoshSai ,

Thanks a lot for your response. I highly appreciate it.

 

I have tried the first approach [0], but there is no option to download a folder including all subfolders/assets.

With curl command [1], I agree we can download. But it will be in zipped format and asset package should be available in AEM. 

 

For now, I can't see anything else other than a custom servlet. But I am looking for some OOTB API or implementation.

 

Avatar

Correct answer by
Level 1

@RO981 

There is no such OOTB feature available. Even the Assets API would download it in ZIP format.

 

There is a discussion on the same topic here, where you need to write a custom servlet, to achieve the usecase.

 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/downloading-adobe-experien...

 

Ideally, you will have to :

1. Query the Assets you want to download.

2. Iterate through result and trigger custom servlet for each iteration to download an asset at a time.

 

Or

Write a custom servlet to download assets in zip format, and then extract it into another folder, delete the base zip file. All in one go.

 

This is going to be a long process and performance intensive.

Avatar

Community Advisor

@RO981 - As I mentioned above "The logic behind this is that when an artefact is uploaded in AEM it becomes a DAM asset and rules governing to it's manipulation take over. For example, in case of PDF, a PDF asset is a collection of the original PDF and all it's images and thumbnail extractions. So when you are downloading something you are basically downloading the whole collection as AEM sees it.

Having said that, you can probably write a custom servlet and extend the DAM GUI to download just the Asset."

 

You could have to customize it based on OOTB functionality!