How can we restrict DAM from uploading assets without an extension | Community
Skip to main content
New Participant
Aug 19, 2021 8:32 PM UTC
Solved

How can we restrict DAM from uploading assets without an extension

There seems to be bug in our project where in I am unable to delete an asset which was loaded without an extension.

I tried to delete and we get a console error.

How can we restrict uploading assets without an extension to DAM? Do we have anything OOB for this fundtionality?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Fanindra_Surat
Fanindra_SuratAccepted solution
New Participant
Aug 19, 2021 9:08 PM UTC

Hi @p_v_nair ,

 

There is no direct OOTB way of restricting upload of assets without an extension, but you could achieve this with few configurations/customisations as below:

 

1.  AEM by default identifies the mime type of an asset using its extension. For assets without an extension, there will not be any mime type detected. So, to restrict upload of these kind of assets that don't have a detected mime type, Disable the "Allow All Mime" Flag of DAY CQ Asset Upload Restriction configuration. But, while doing so, please make sure that you are adding all the expected different Mime types in the "Allowed Asset MIMEs" field.

2. Customise the DAM Update Asset Workflow with an additional process step that checks for extension less assets and deletes them.

 

Hope this helps.

Thanks!

3 replies

Bhuwan_B
New Participant
Aug 20, 2021 4:00 AM UTC

@p_v_nair Write a filter to validate the file before it gets uploaded in DAM. Refer a sample filter below :

http://experience-aem.blogspot.com/2018/11/aem-6420-file-decode-filter-virus-scan-to-decode-uploaded-files-for-create-asset-servlet.html

Translate
Kishore_Kumar_
Level 9
Aug 20, 2021 3:58 AM UTC
Fanindra_Surat
Fanindra_SuratAccepted solution
New Participant
Aug 19, 2021 9:08 PM UTC

Hi @p_v_nair ,

 

There is no direct OOTB way of restricting upload of assets without an extension, but you could achieve this with few configurations/customisations as below:

 

1.  AEM by default identifies the mime type of an asset using its extension. For assets without an extension, there will not be any mime type detected. So, to restrict upload of these kind of assets that don't have a detected mime type, Disable the "Allow All Mime" Flag of DAY CQ Asset Upload Restriction configuration. But, while doing so, please make sure that you are adding all the expected different Mime types in the "Allowed Asset MIMEs" field.

2. Customise the DAM Update Asset Workflow with an additional process step that checks for extension less assets and deletes them.

 

Hope this helps.

Thanks!

Translate