maybe this is your answer
Just don't get your question. But perhaps this is your answer.
<input type="file" name="pic" id="pic" accept="image/gif, image/jpeg" />
Some browsers do not support this command. Third are supported, but only valid formats are not displayed in the drop-down list.
And never trust your user, just confirm sending the user on the server side, for example PHP
source share