.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

filter option for file upload browse button asp.net

Posted By: Kumar     Posted Date: February 27, 2009    Points:2   Category :ASP.Net
Hi All,

I am struggling from past 1 week to find out whether there is option of giving filtering option for the Browse button of file upload control in asp.net 2.0

my requirement is when the user clicks on the browse button of the file upload control in web application suppose i want .jpg files only, then on click of browse button in the open dialog box only the .jpg files should open, other than that i don't want any other files to be get selected

Best example is open a word document and in that when u click on open of a word document in that the open dialog box only shows the word document other than that it won't show anything else.

Hope this made u understood

Can you please help me out

Thanks and regards,

Author: susant             
Posted Date: March 01, 2009     Points: 5   

Hi Kumar

I think in windows application browse file dialogue control by using .filter properties u can fulfull ur requirements.. but in web application by using fileupload control, i dont think it will work...

I suggest: Let the user upload any file but in .cs file take the .Extension properties of uploaded file and check the file is .jpg or any file whatever u want..


Author: Kumar             
Posted Date: March 01, 2009     Points: 5   

Hi Susant,

Thanks for the reply that you have given and i wrote the code for restricting the user from not to take any other file except the .jpeg file,but my clients requirement is to get in that way

Hence i am struggling,

Thanks and Regards,

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend