1

enter image description here

I want to upload a .xlsx file to my systems with condition that the file name contains a specified string.

For example: I want to upload file whose name contains "Paper", so the file browser should not display files which don't contain "Paper" in their name.

For the example in the photo that I attached in this post, the file 'Order#...' should not be displayed.

How can i do it? Is it possible to implement this idea? thanks.

2 Answers2

2

You can use accept attribute
Try this code

<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />

Read more here

Community
  • 1
  • 1
Divyesh Savaliya
  • 2,453
  • 2
  • 13
  • 31
0

You can use the accept attribute. Some older browser do not support it, but i think it is not an issue yet

The Bitman
  • 1,192
  • 10
  • 22