Expand my Community achievements bar.

SOLVED

ASC - Download DAM Asset in original format without zipping

Avatar

Level 1

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 ?

1 Accepted Solution

Avatar

Correct answer by
Level 2

@Shelson 

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>

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @Shelson 

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

Avatar

Level 1

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

Avatar

Correct answer by
Level 2

@Shelson 

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>