Prevent document from auto downloading in asset share commons | Community
Skip to main content
Level 6
January 4, 2024
Solved

Prevent document from auto downloading in asset share commons

  • January 4, 2024
  • 2 replies
  • 746 views

I want to prevent the auto download of documents in asset share commons. Is there a config to do this?

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 Madhur-Madan

Hi @shaheena_sheikh ,

To my knowledge ASC provides control over how assets are shared and accessed, but the auto-download behavior might not have a direct configuration setting. However, you can try to manage this behavior indirectly using
1. Access Controls: By allowing group/user read only access at folder level or asset level.

2. JavaScript-Based Solution: Utilize JavaScript to intercept the click event on the asset links and provide a custom behavior like

document.addEventListener('DOMContentLoaded', function() { const assetLinks = document.querySelectorAll('.asc-asset-link'); // Example selector for ASC asset links assetLinks.forEach(link => { link.addEventListener('click', function(event) { event.preventDefault(); // Prevent the default behavior (e.g., download) // You can implement custom logic here, like displaying a confirmation modal or opening the asset in a new tab/window. }); }); });


Let me know if it works

2 replies

Kamal_Kishor
Community Advisor
Community Advisor
January 4, 2024

Hi @shaheena_sheikh : Please refer asset-share-commons documentation for enabling/disabling direct download option. Also, please check if it is supported for the version you are using.

https://opensource.adobe.com/asset-share-commons/pages/actions/download/#dialog--behavior

 

 

Kamal_Kishor
Community Advisor
Community Advisor
January 8, 2024

Hi @shaheena_sheikh: Did you get a chance to try this suggestion as well. Please let me know if this helps in some way.
Thanks.

Madhur-Madan
Community Advisor
Madhur-MadanCommunity AdvisorAccepted solution
Community Advisor
January 4, 2024

Hi @shaheena_sheikh ,

To my knowledge ASC provides control over how assets are shared and accessed, but the auto-download behavior might not have a direct configuration setting. However, you can try to manage this behavior indirectly using
1. Access Controls: By allowing group/user read only access at folder level or asset level.

2. JavaScript-Based Solution: Utilize JavaScript to intercept the click event on the asset links and provide a custom behavior like

document.addEventListener('DOMContentLoaded', function() { const assetLinks = document.querySelectorAll('.asc-asset-link'); // Example selector for ASC asset links assetLinks.forEach(link => { link.addEventListener('click', function(event) { event.preventDefault(); // Prevent the default behavior (e.g., download) // You can implement custom logic here, like displaying a confirmation modal or opening the asset in a new tab/window. }); }); });


Let me know if it works