Setting file type in ASP.net download file

Can I restrict the asp.net file download dialog to view only XML files? (Filer, only .xml)


Note. Do not check if the extension is .xml, but actually allow the user to view the xml files in the dialog box.

+1
source share
2 answers

It's impossible.

+2
source

Unfortunately, you cannot set a filter for the file browser dialog - you need to use JavaScript or server-side validation to expand.

Upd. You can use the regex validator with the following regex line:

@"(.*?)\.(jpg|jpeg|png|gif)$"
0

Source: https://habr.com/ru/post/1753296/


All Articles