PV_PN
PV_PN

Reputation: 103

Restrict only a specific AEM DAM folder with a filetype

I have a requirement to restrict only a particular DAM folder in AEM with upload restriction of svg files only. I believe we need to overlay fileUpload.js from libs(/libs/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js) folder to apps folder. And make changes to this js to make this possible. Has anyone achieved this and does any one have a sample code for this js changes to restrict a filetype for a particular dam folder only?

Upvotes: 0

Views: 952

Answers (1)

Oliver Gebert
Oliver Gebert

Reputation: 1176

instead of writing an overlay and messing with Adobe's UI code (which might change without notice) I would rather go for one of the following two options:

  1. Don't do it ;-)
  2. Don't do it - but, if you really have to make sure there are no other file formats in specific folders (I really can't imagine why this should be the case) -> let the user upload files as usual, check those files with an event handler or workflow, if files are uploaded into folders that should not contain that filetype (the folders should be configurable in OSGi console), move them to another place and generate a message / mail to the uploader so he nows what went wrong and where to find his stuff.

This might seem like it is more complicated, but in the end, it is a one time change, with a configurable folder list and it has no dependencies to any overlays.

On top of that you will not have to check overlayed JS libs for changes with each fix that is installed on the machine.

HTH OliG

Upvotes: 2

Related Questions