Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 FileUpload file filter

Author  Topic 

juicyapple
Posting Yak Master

176 Posts

Posted - 2008-06-03 : 20:29:56
Hi, anyone knows how to filter file in the fileupload component? I need to filter it and show only .txt and .xls file type.

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-06-03 : 21:20:29
You can't filter what shows in the dialog, that is completely controlled by the web browser. You can validate the input to ensure that the filename being uploaded has the extension you want:

http://forums.asp.net/p/1156963/1902238.aspx

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

juicyapple
Posting Yak Master

176 Posts

Posted - 2008-06-03 : 22:44:19
quote:
Originally posted by jsmith8858

You can't filter what shows in the dialog, that is completely controlled by the web browser. You can validate the input to ensure that the filename being uploaded has the extension you want:

http://forums.asp.net/p/1156963/1902238.aspx

- Jeff
http://weblogs.sqlteam.com/JeffS




how to clear the text in the uploadfile? if the selected file type is not correct, i would like to clear the file path...
Go to Top of Page

ayamas
Aged Yak Warrior

552 Posts

Posted - 2008-06-04 : 13:50:32
You can use javascript for that.Because the fileupload component is rendered as input text on the page.You can use document.getelementbyid('fileuploadid').value=''
Go to Top of Page
   

- Advertisement -