AEM 6.5.19 On-Prem Restrict DAM Upload Size (not by mime type)
We are looking to prevent uploads of very large files, for example we don't want people uploading 1g movies, or 200mb jpegs - or things like that - we probably want to restrict to 50-100mb - and potentially have different rules for different DAM paths, and maybe file types.
AEM Support mentioned there was no way to do this out of the box - I noted it seems to be configurable in their Cloud Service offering - https://experience-aem.blogspot.com/2021/05/aem-cloud-service-configure-file-upload-max-size-per-asset-type-restrict-upload-ui.html - support suggested a custom workflow triggered on DAM Upload Asset - to check the file size / (path if required) - and accept or reject (exit) if size is exceeded - before proceeding.
Has anyone in the community done something similar and would you be willing to share your code?
Support also mentioned this config: "Day CQ DAM Asset Upload Restriction" - but that doesn't address the file size as far as I can tell.
Thank you.