Extending DAM Asset Upload Restriction - UI Notification

Avatar

Avatar

vivek-sachdeva

Avatar

vivek-sachdeva

vivek-sachdeva

23-12-2020

Hi,

 

Currently we have requirement to add restrictions to DAM Asset Upload which checks file type, size and file content using for 3rd party API. We do this in DAM Update Asset Workflow by adding a custom step.

 

Currently we are stuck at a place where in case when file is not allowed, we are not able to show alert on UI to authors with some message. I see that "DAM Asset Upload Restriction" configuration has a nice alert saying upload failed. From what I checked that calls a servlet which returns error and then this alert is shown.

 

Is there a way we can do the same for our custom restrictions. If workflow is the best way for that or if we can have another way of doing it which is more user friendly.

 

Any help is appreciated..

 

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

kunal23

MVP

Avatar

kunal23

MVP

kunal23
MVP

24-12-2020

Instead of workflow you can write a filter to validate the file before it gets uploaded in AEM. 

You can find a sample of that filter here - http://experience-aem.blogspot.com/2018/11/aem-6420-file-decode-filter-virus-scan-to-decode-uploaded... 

The user will see the message even before the asset is uploaded in AEM. 

Answers (1)

Answers (1)

Avatar

Avatar

shelly-goel

MVP

Avatar

shelly-goel

MVP

shelly-goel
MVP

24-12-2020

@vivek-sachdeva 

Another solution of adding upload restrictions like asset size, etc. could be done with overlaying this node: /libs/dam/gui/content/assets/jcr:content/actions/secondary/create/items/fileupload

and if 3rd party api logic has to be leveraged, that can be done by customizing below file which has "restrictedFiles" logic

/libs/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js

These details are also mentioned in this post: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-dam-file-uploading/qaq...