Restrict PDF documents to upload into a particular DAM Folder | Community
Skip to main content
Anudeep_Kumar
Level 2
August 12, 2023
Solved

Restrict PDF documents to upload into a particular DAM Folder

  • August 12, 2023
  • 3 replies
  • 1173 views

Hi All,

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

Thanks in Advance.

Regards,
Anudeep

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lukasz-m

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

3 replies

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
August 13, 2023

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
Prashardan
Level 4
July 25, 2024

Hi @lukasz-m 

 

I have a similar requirement, like I want only contentfragments and jsons to be allowed under /content/dam/project-folder/subproject-folder.

 

I would like to go with the first approach that is 

  • frontend - overlay following path /libs/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js, and make appropriate changes

Could you please give me more idea on this.

Mahedi_Sabuj
Community Advisor
Community Advisor
August 13, 2023

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.

 

Mahedi Sabuj
Prashardan
Level 4
July 26, 2024

Hi @anudeep_kumar 
May I know you got your solution. If yes, may I know your approach.