adobe / asset-share-commons

A modern, open-source asset share reference implementation built on Adobe Experience Manager (AEM)
https://opensource.adobe.com/asset-share-commons/
Apache License 2.0
88 stars 107 forks source link

External share direct download option #1075

Open bkhub5 opened 9 months ago

bkhub5 commented 9 months ago

Hi All,

We have encountered a use-case wherein we need to generate an external share link from Asset Share, upon clicking of which it would automatically start with the download of the assets part of the shared link. The user won't be required to open select and manually download the assets.

Example: User shares a set of assets from Asset Share (external link) User generates this link and when opened in a new tab - this downloads the zip of the assets.

From the current implementation, the "download" feature works via adhocassetshare /libs/dam/gui/coral/components/admin/adhocassetshare/clientlibs/landingpage/js/landingpage.js

Is there an existing feature already which can provide this feature as part of ASC? Please let me know if there are alternatives to this as well?

Screen-1 Screen-2

Thanks.

davidjgonzalez commented 9 months ago

@bkhub5 nothing like this exists ... and this is in large part due to:

  1. GET URLs have size limits; and during the early days of ASC, folks were still (unfortunately :)) using IE11 which if i recall had a limit of 2048 characters. Since asset paths are used to identify the assets to download, 2048 characters can be quickly exceeded. You want a HTTP GET since these links are clicked from emails/shared. This is why download action clicks are HTTP POST (unlimited size).
  2. Theoretically we could store a UUID to assets-to-download-list, and use that UUID as the link, but that means we need someplace for users to write back to (and then probably clean up jobs). We dont have a easy place for that in AEM CS Publish, and didnt want to introduce some 3rd party requirement to store data.
  3. Event if we could get a reliable HTTP GET URL -- In AEM CS, creation of a download zip is async (which can take seconds to minutes depending on the size) ... so we cant just link to a URL that returns a zip -- we would need to link to a page, that kicks off a download, and then provides the UI for the user to monitor the download zip creation progress, and then allow them to download once complete. Which is all rather involved UX.

Anyhow - this is a long way of saying we dont have this in ASC, and its a non-trivial implementation - and im sure there are nuances and challenges im not realizing at the moment would arise when implementing.

Im happy to brainstorm how you could implement this in your project tho -- and if there are minor changes to make in ASC that custom extension easier, make those!