How to add custom rule for only pdf(s) that are uploaded shouldn't have special chars, space or caps and max size limited to 5mb? | Community
Skip to main content
Level 2
April 22, 2022

How to add custom rule for only pdf(s) that are uploaded shouldn't have special chars, space or caps and max size limited to 5mb?

  • April 22, 2022
  • 1 reply
  • 1006 views

I've tried by going to /apps/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js but the issue is it gets applied to all assets in general. But I want to add separate rules for PDF, and separate one for images.
Tried in the following manner:

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Adobe Employee
April 25, 2022

Hi,

Welcome to AEM Community !!

Did you try creating a MIME type for apply that restrictions on file upload?

Just like this one : https://experienceleague.adobe.com/docs/experience-manager-65/assets/administer/configuring-asset-upload-restrictions.html

Thanks,

Vikram Gaur

ac6600Author
Level 2
April 25, 2022

Hi Vikram,

 

Thanks for the heads-up. But in the link, what I could find is how to restrict type of files to upload in assets(.img , video etc.). My question was to limit the size of pdfs and images, and use custom rules for naming where it won't allow special chars, caps, and spacing. Also there will be separate set of rules for pdf and image.

 

I tried by navigating to /apps/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js and modified the code (shown in the image), but that gets to applied all assets in general.