Check out example codes for "input type file pattern attribute in html". It will help you in understanding the concepts better.

Code Example 1

<input type="file" name="my-image" id="image" accept="image/gif, image/jpeg, image/png" />
To select only image files, you can use this accept="image/*"

<input type="file" name="my-image" id="image" accept="image/*" />

Learn ReactJs, React Native from akashmittal.com