Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

filter the file type with the file upload control

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

like image 508
subash Avatar asked Mar 24 '10 10:03

subash


People also ask

What is file upload control?

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.

What are file filters?

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.


1 Answers

It works perfectly!

<asp:FileUpload ID="FileUpload1" runat="server" accept=".xls, .xlsx"/>
like image 97
Alex Avatar answered Oct 09 '22 14:10

Alex