Hi experts
I have checked all the questions related to attachments names and haven't found anything solving my problem.
Considering Confiforms doesn't support any kind of names changing on submitting the form, I am trying to validate the names instead and not letting the users to upload a file if doesn't match a certain name, built up with other fields.
It is pretty easy to force the user to upload a static name. Just have to set Validate rules in the field definition as, i.e., MYFILENAME.* and everything works fine.
My problem starts when I am trying to do this dinamically. Let's say we have a field named USERNAME and I want to validate the name of the files setting up validation rules as [entry.USERNAME]. It is not working.
I have trying both in the field definition and setting rules for field definition and anything seems to work. I have tried using with and without [], also MyFileField.asAttachement.displayTitle:[entry.USERNAME], .fileName:[entry.USERNAME], [entry.MyFileField.etc]:USERNAME and all the possible combinations with those syntaxis. Nothing works.
Is there any way I can do that? Am I approaching this problem correctly?
Thanks for your help.