Expand my Community achievements bar.

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

4 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

Level 4

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.

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.

 

Avatar

Level 4

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