Hello! we have a requirement where we have to limit uploads by size at folder level. Like one folder can have max 20mb, where other can only take 10mb. Is it possible via configuration. If not any ideas/suggestions on this requirement?
But, in your case it is not, you need to set it up at the folder level, you can try the below approaches.
1. workflow process
Create a separate workflow process step and in the execute method get the file size either by reading the metadata of the file or reading the size of inputStream, etc, if it crosses a certain amount then you can stop uploading the Asset.
You need to add this in the "DAM Asset Upload" workflow.
2. If you are going to upload Asset via component, file upload field, then you need to write a custom servlet. you will have full control here.
Try to add a Custom Process Step in "Dam Upload Asset" (/libs/cq/workflow/content/console.html) workflow which checks the size of uploaded image and allowed size for the folder and continue if satisfies or stop the upload process