how to filter the file type with the file upload control in asp.net & c#.net
for example on clicking the browse button of the file upload control ,it should open browse file dialog with only excel file types.
how is it possible
The FileUpload control allows the user to browse for and select the file to be uploaded, providing a browse button and a text box for entering the filename.
Filters allow you to set restrictions on the content in a file or folder that is available for translation. Filters are available for Word, Excel, text, XML, and JSON files. You can also add filters to unsupported file types using a text file type filter.
It works perfectly!
<asp:FileUpload ID="FileUpload1" runat="server" accept=".xls, .xlsx"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With