Can I use regex or any other approach to limit file upload file sizes?
Hey folks,
We've got a client request to allow photo submissions via their website. They have Formulate 1.3.1 which supports file attachments. But how can we limit the file size people try to upload? Many email servers won't send out large attachments and incoming email (and hosting server storage limits) also come into play.
Any help appreciated.
Thx,
AE
Regex would probably not work, but you could probably create a custom validation or a custom field. For example, the Recaptcha field does server side validation to validate that the answer is correct. You could do something similar.
Refer to the code for examples. Let me know if you need any tips about where to look.
BTW, regex might work to validate file extensions, but I can't remember if the regex validation works for file upload types.
Can I use regex or any other approach to limit file upload file sizes?
Hey folks, We've got a client request to allow photo submissions via their website. They have Formulate 1.3.1 which supports file attachments. But how can we limit the file size people try to upload? Many email servers won't send out large attachments and incoming email (and hosting server storage limits) also come into play. Any help appreciated. Thx, AE
Edit: And can we restrict file types/extensions?
Regex would probably not work, but you could probably create a custom validation or a custom field. For example, the Recaptcha field does server side validation to validate that the answer is correct. You could do something similar.
Refer to the code for examples. Let me know if you need any tips about where to look.
BTW, regex might work to validate file extensions, but I can't remember if the regex validation works for file upload types.
is working on a reply...