Hi,
I tried some code for you to get file extension by using filename
DirectoryInfo dinfo = new DirectoryInfo(Server.MapPath("~/Images"));
FileInfo[] finfo = dinfo.GetFiles("winter.*");
int l=finfo.Length;
string ext=Path.GetExtension(finfo[0].FullName);
Here you've to pass your file name instead of "winter"
Then The file information stored in finfo array.
So we can get that file extension
I hope you understood What I said
All the Best