Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Extending DAM Asset Upload Restriction - UI Notification

Avatar

Level 2

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!

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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. 

View solution in original post

6 Replies

Avatar

Correct answer by
Employee Advisor

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. 

Avatar

Level 10

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

 

Avatar

Level 2
Thanks for the reply Shelly.. Do understand that OOTB JS can be modified but I believe we should not modify OOTB code unless there is no other way. this could create issues while upgrading. In case there are updates to this file, we may not get it