Prevent special characters in multi upload field

28 views
Skip to first unread message

Daniel R.

unread,
Jul 17, 2025, 10:54:49 PM7/17/25
to Orbeon Forms

Hello

For single upload fields I can check the file name for special characters, this works with the following validation formula:

not(matches(@filename, '[~"#%&*:<>?/\\{|}^$@!]'))

Now I want the same for multiupload fields. Does anyone have an idea?

Best regards,
Daniel

Alessandro Vernet

unread,
Jul 17, 2025, 11:03:52 PM7/17/25
to orb...@googlegroups.com
Hi Daniel,

Try the following:

    empty(_[matches(@filename, '[~"#%&*:<>?/\\{|}^$@!]')])

This may seem increasingly cryptic, but it's actually quite simple ;). When using a Multiple File Attachments control, each file is stored in a child element `<_>`. The expression above simply checks whether any file name contains any of the specified characters; and ensures that none do.

I hope this helps,

-Alex

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/orbeon/9c6d1077-c73f-4954-b170-31058417513en%40googlegroups.com.

Daniel R.

unread,
Jul 18, 2025, 8:44:56 PM7/18/25
to Orbeon Forms
Hello Alex,

Thank you very much, that works well. Perfect.

Best regards and a nice day,
Daniel


Alessandro Vernet

unread,
Jul 19, 2025, 2:04:29 AM7/19/25
to orb...@googlegroups.com
Excellent, Daniel. And thank you for the update.

-Alex

Reply all
Reply to author
Forward
0 new messages