ASC - Download DAM Asset in original format without zipping | Community
Skip to main content
New Participant
May 12, 2022 2:16 PM UTC
Solved

ASC - Download DAM Asset in original format without zipping

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.
harishdevAccepted solution
Level 2
May 13, 2022 7:27 AM UTC

@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>

3 replies

harishdevAccepted solution
Level 2
May 13, 2022 7:27 AM UTC

@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>
Translate
RajaShankar
New Participant
May 12, 2022 3:27 PM UTC

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

Translate
shelson1Author
New Participant
May 13, 2022 2:12 PM UTC

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

Translate