Is it possible to limit the type of attachment? I would suspect some type of JavaScript could be used to check the file extension, but I'm not sure on how to go about it. For example, if I wanted to limit only pdf files could be uploaded, how would I do that?
Wrote this a while back, but it should still work and give you a place to start:
-------- Email subject: Update on Your Request Hello,
You could add the following code to your custom code block for your form where the users should upload only pdfs. Note that this as written will not allow them to submit a form with no file-uploads. If that is an issue, let me know and I'll rework it.
<script type="text/javascript"> wFORMS.behaviors.validation.rules.isPDF= { selector: ".validate-pdf", check: 'isPDF' } wFORMS.behaviors.validation.messages.isPDF = "This file is not a PDF.";
Just tested it. Works perfectly. It would be nice as an enhancement to have this in the console to limit file types and sizes. I know the code you provided doesn't help on the file size and I'm not even sure it is even possible, but that would be a nice feature.
Unfortunately last I checked this is impossible client side due to the Javascript limited security setup. Other than the direct file location, which I believe is supplied by the browser, javascript can't pull any info about files off your hard drive. The only way to check that sort of thing client side is java or flash, both of which introduce their own problems.
Maybe that's changed since last I looked, but I'd be surprised.