By default it can select all type of files,how to restrict it so that it can only select
You can use the accept attribute on your form to suggest to the browser to restrict certain types. However, you’ll want to re-validate in your server-side code to make sure. Never trust what the client sends you.
<input type="file" accept="application/pdf" />