Change allowed file types based on certain criteria
So, it's the rough instruction step by step as Matt asked:


Add new field where you can specify the allowed extensions of the files.
Alter the form of your submission via hook_form_alter() and find your file upload field 
Specify your allowed extensions from your field with extensions into this point