Dynamic values for validations rules for file inputs

Hi, how to apply dynamic value into the validation rules for file input:
For both server actions and app connect:
For example, allow users in a backend to set the type and max of files that can upload.
This inputs are static right now.
A workaround is to check the size inside a condition and the same for type of file. But would me more efficient if this value can be bind directly in the component.