Атрибут accept в <input type="file">
устанавливает фильтр на типы файлов в окне выбора файла. В качестве значения может использоваться разрешение файлов или их MIME-типы (например: image/jpeg).
Выбор только файлов PNG:
<form action="" method="post" enctype="multipart/form-data">
<label>Файл PNG:</label>
<input type="file" name="file" accept=".png">
</form>
Выбор только файлов JPG, JPEG, PNG:
<form action="" method="post" enctype="multipart/form-data">
<label>Файл JPG или PNG:</label>
<input type="file" name="file" accept=".jpg,.jpeg,.png">
</form>
Так как у файлов с одним MIME-типом может быть множество расширений, то проще сделать фильтровку по нему, например text/plain.
<form action="" method="post" enctype="multipart/form-data">
<label>Текстовые файлы:</label>
<input type="file" name="file" accept="text/plain">
</form>
В HTML5 допустимо указывать группу файлов:
<form action="" method="post" enctype="multipart/form-data">
<label>Графические файлы:</label>
<input type="file" name="file-1" accept="image/*">
<label>Аудио и видео файлы:</label>
<input type="file" name="file-2" accept="audio/*,video/*">
</form>