Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Restrict PDF documents to upload into a particular DAM Folder

Avatar

Level 2

Hi All,

is there any way to restrict uploading PDF assets into a particular DAM Folder in AEM.

Thanks in Advance.

Regards,
Anudeep

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Anudeep_Kumar,

This is not possible OOTB. What it supported, is to restrict specific MIME types for entire DAM. Please check below documentation, for all the details how you can configure it:

If you want to restrict possibility to upload specific file type e.g. PDF only to particular folder, you will have to do some customization. I see 2 options:

  • frontend - overlay following path /libs/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js, and make appropriate changes
  • backend - create some filter that will be executed in asset upload chain that is handled by:
    • com.adobe.cq.dam.processor.nui.impl.servlet.InitiateUploadAssetServlet - correlated with initiateUpload selector, e.g. /content/dam.initiateUpload.json
    • com.day.cq.dam.core.impl.servlet.CreateAssetServlet - that is using createasset selector, e.g. /content/dam.createasset.html

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @Anudeep_Kumar,

This is not possible OOTB. What it supported, is to restrict specific MIME types for entire DAM. Please check below documentation, for all the details how you can configure it:

If you want to restrict possibility to upload specific file type e.g. PDF only to particular folder, you will have to do some customization. I see 2 options:

  • frontend - overlay following path /libs/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js, and make appropriate changes
  • backend - create some filter that will be executed in asset upload chain that is handled by:
    • com.adobe.cq.dam.processor.nui.impl.servlet.InitiateUploadAssetServlet - correlated with initiateUpload selector, e.g. /content/dam.initiateUpload.json
    • com.day.cq.dam.core.impl.servlet.CreateAssetServlet - that is using createasset selector, e.g. /content/dam.createasset.html

Avatar

Community Advisor

Hello @Anudeep_Kumar, As @lukasz-m mentioned, there isn't an OOTB solution for restricting PDF uploads to a specific folder. Nevertheless, you can utilize AEM workflow to achieve this restriction.

To implement this, you'll need to develop a custom workflow process responsible for validating asset mime types. You can refer to the Sample Workflow Process for guidance.

After creating the custom workflow process, the next step involves creating a workflow model that incorporates the newly generated process as one of its steps.

Finally, to complete the process, you'll establish workflow launcher. In the launcher, configure both the asset path and the designated workflow model for seamless operation.