get file extension in c# file upload

63

c# get file extension -

string myFilePath = @"C:\MyFile.txt";
string ext = Path.GetExtension(myFilePath);
// ext would be ".txt"

get file extension in c# file upload -

string extension=System.IO.Path.GetExtension(file1.FileName);

Comments

Submit
0 Comments