开发者

Setting the filetype in ASP.net fileupload

开发者 https://www.devze.com 2022-12-20 16:45 出处:网络
Is it possible to limit the asp.net fileupload dialog to view only XML files? (Filer, .xml only) Note: Not to check whether the extension is .xml, but to actually only l开发者_运维技巧et the user vi

Is it possible to limit the asp.net fileupload dialog to view only XML files? (Filer, .xml only)

Note: Not to check whether the extension is .xml, but to actually only l开发者_运维技巧et the user view xml files in the dialog.


It is not possible.


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

Upd. You can use RegularExpression validator with the following regex string:

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

精彩评论

暂无评论...
验证码 换一张
取 消