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!!
Solved! Go to Solution.
Views
Replies
Total Likes
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.
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.
Hi @RO981,
There can be below options you may consider
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.
Hope that helps!
Regards,
Santosh
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.
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.
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.
@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!
Views
Likes
Replies