Here it is explained how to limit the number of files to upload when Allow multi HTML5/Flash uploads checkbox is checked.
Please follow these instructions.
Go to Properties of the "File upload" element in your form and in the Validation section check Required checkbox. Then select Custom as the validation type and in the code area paste in the following:
function ff_uploadelementname_validation(element, message) { var children = jQuery('.bfFlashFileQueueClass').children(); var len = Number(children.length); console.log(len); if ( len > 3) { if (message=='') message = " Too many files uploaded.\n" ff_validationFocus(element.name); return message; } // if return ''; }
NOTE: In the code above replace uploadelementname with the Name of your File upload element.
This is the example where 3 is the maximum number of files to upload.
In the following line of code, replace 3 with the maximum number wanted.
That will limit the number of files that can be uploaded.
If a user tries to submit the form with too many files uploaded an error message will be shown and won't be able to submit the form until he reduces the number of uploaded files to less or equal to the maximal.