What is the use case? Do you want depending on the extension allow uploads of different sizes? If so you could use a file extension enum first to select the extension and then open different upload screens which have the allowed size settings.
Regards,
Ronald