In this article I will explain with an example, how to make FileUpload control accept all files in ASP.Net.
The accept attribute is a new attribute available in HTML5.
HTML Markup
The HTML Markup consists of:
FileUpload – For selecting file.
The FileUpload control has been set with the following attribute.
accept – This attribute allows user to select only specified type of files from the Choose File dialog box.
Note: Accepting all files is default behaviour and hence even if the accept attribute is not specified, by default, it will accept all files.
For example, in the following code, the FileUpload control will allow user to select All files i.e. file with all extensions.
<asp:FileUpload runat="server" accept="*.*" />
Screenshot
Browser Compatibility
* All browser logos displayed above are property of their respective owners.
Demo
Downloads