Forums

File type checking when file is not required

wlwan 28 Jul, 2015
Dears,
Have created a form, visitor can upload max 5 files, it's optional, not a required field
after file uploading, system will send out email to internal parties for following up.
hv limited the file type to be jpg, pdf and doc, max file size: 10MB
the form works nice, except....

when i upload combination of valid and invalid file, the form still pass and send out email with those valid files.

example:
file to upload: aaaa.jpg, bbbb.pdf, cccc.html
error message warning for the invalid file type after submit form
file in email: aaaa.jpg, bbbb.pdf

Is there any way to modify to make it works?
wlwan 28 Jul, 2015
hv read this FAQ http://www.chronoengine.com/faqs/54-cfv4/cfv4-validation/2656-how-can-i-add-a-custom-client-side-validation.html

But seems like I can't use for my non-required fields... and also, not familiar to regular expression, hv no idea how to set it up😢

Best regards,
Wing
GreyHead 28 Jul, 2015
Hi wlwan,

Do you have an Event Loop action in the pink On Fail box of the Files Upload action?

Bob
wlwan 28 Jul, 2015
Yes, I did....
I work nice if all files are invalid, but fail if only some are invalid among those files...

Best regards,
Wing
GreyHead 28 Jul, 2015
Hi Wing,

It's working OK when I test but there was a bug see this thread

Please make sure that you have the latest 5.0.9 version of CFv5, If that hasn’t fixed it please contact Max for the patch file.

Bob
wlwan 28 Jul, 2015
Dear Bob,
Thanks for yr reply
Hv checked, I'm using 5.0.9 already, so I hv leave message to max by contact us page and wait for reply.
(Hvnt updated the latest joomla, still using 3.4.1, not sure if it's the issue...)

Best regards
Wing
This topic is locked and no more replies can be posted.