Hi - I’m trying to limit a file upload to just gifs or jpgs. Here is the code for the field I have:
<input type="file" name="photo" id="photo" eform="photo::1:Please upload only a gif or jpg file:#REGEX ^([a-zA-Z].*|[1-9].*)\.(((j|J)(p|P)(g|G))|((g|G)(i|I)(f|F)))$" />
The form validation works fine otherwise and the field is required as it should be but any file is allowed. I’ve used this expression before, tried a couple other expressions too no luck - just doesn’t seem to check the upload.
Is there any way to do this using eform’s validation?
Thanks,
Jared
-
☆ A M B ☆
- 24,524 Posts
With eForm 1.4 you can restrict the types of files that are accepted by the #LIST validation rule
<input class="field" type="file" name="attachment" eform="Attachment:file:0:Only upload of text documents are supported:#LIST pdf,txt,doc " /></p>
Thanks - musta missed that in the documentation. Where was it - out of curiousity?
Appreciate the help.
-Jared
-
☆ A M B ☆
- 24,524 Posts
In one of the "sample" files that comes with the eForm download.