Id’s are usually not necessary, there are many ways to get the needed specificity in your selectors. When targeting form input elements, you don’t need id’s because you can target the name attribute if you need that kind of specificity.
I will say that if you’re trying to style a file upload field, the problem is not specificity, it’s that most browsers limit how it can be be styled. Do a web search on CSS styling of file upload fields and you’ll see all kinds of schemes for doing so, none of them straightforward.
The “professional” solution is typically to use javascript to build a custom file upload interface that will be consistent across all configurations.