Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Group members,
I have file upload control.The user might upload any of the document(PDF,Word Document,Notepad).After browsing when the user click's Upload button I want to know he extension of the document.Can any one tell me how can I get the extension of the document.
Posted

1 solution

Try:
C#
string filename = myUploadControl.Filename;
string extension = filename.Substring(filename.LastIndexOf('.') + 1);
 
Share this answer
 
Comments
SAM_India 4-Jan-12 5:53am    
Hi Griff,
Thank you very much for your balze response

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900