ASC - Download DAM Asset in original format without zipping | Community
Skip to main content
May 12, 2022
Solved

ASC - Download DAM Asset in original format without zipping

  • May 12, 2022
  • 2 replies
  • 1073 views

Hi All,
We have a requirement to download asset in original file format without zipping the file. Suppose if we try to download the jpg file, it should be downloaded as jpg files format itself. Could anyone suggest any way to achieve that ?

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 harishdev

@shelson1 

You can simply update the HTML button to have an anchor tag with a href of the JPEG(or equivalent) asset path.

/apps/asset-share-commons/components/details/action-buttons/action-buttons.html

    <button class="ui primary button cmp-action-buttons__button"
                    data-asset-share-id="download-asset"
                    data-asset-share-asset="${asset.path}"
                    data-asset-share-license="${config.licenseEnabled ? asset.properties['license'] : ''}"
                    data-sly-test="${properties['downloadLabel'] && config.downloadEnabled}">
           ${properties['downloadLabel']}
    </button>

2 replies

RajaShankar
Community Advisor
Community Advisor
May 12, 2022

Hi @shelson1 

This can be done by overriding AssetDownloadServlet. Please refer this article for implementation details

https://aem4beginner.blogspot.com/overriding-out-of-box-servlet-in-aem

 

Hope this helps.

 

Regards,

Rajashankar.R

shelson1Author
May 13, 2022

Tried this but doesn't work as expected. Could you please suggest any other solution ?

harishdevAccepted solution
Level 2
May 13, 2022

@shelson1 

You can simply update the HTML button to have an anchor tag with a href of the JPEG(or equivalent) asset path.

/apps/asset-share-commons/components/details/action-buttons/action-buttons.html

    <button class="ui primary button cmp-action-buttons__button"
                    data-asset-share-id="download-asset"
                    data-asset-share-asset="${asset.path}"
                    data-asset-share-license="${config.licenseEnabled ? asset.properties['license'] : ''}"
                    data-sly-test="${properties['downloadLabel'] && config.downloadEnabled}">
           ${properties['downloadLabel']}
    </button>