Validate total combined file attachment size


(Michael Wilson) #1

Matrix Version: 6.34.0

On a Custom Form, with multiple file upload fields, is there a way to check that the total size of all file attachments combined doesn’t exceed an arbitrary limit?

Matrix allows me to add file size validation to each file upload form field, but what about enforcing an email message size limit which might be enforced by an organisation on the receipient emails sent as a result of a form submission? I’d like to be able to tell the end user, and validate, something like “Please ensure each file is less than 5MB in size and the total of all files is less than 20MB”.


(Harinder Singh) #2

You can achieve it by JS