private static bool IsVideo(HttpPostedFile file) { bool isVideo = false; string fileName = file.FileName; IList<string> formateList = new List<string> { "avi","flv","mpg","mpeg","mpe","m1v","m2v","mpv2","mp2v","dat","ts","tp","tpr","pva","pss","mp4","m4v", "m4p","m4b","3gp","3gpp","3g2","3gp2","ogg","mov","qt","amr","rm","ram","rmvb","rpm"}; if (formateList.Contains(fileName.Split('.')[1])) { isVideo = true; } return isVideo; }