public static string ExtractMimeExtension(string mime) { var mimeInfo = MimeType.FindMime(mime); if (mimeInfo != null) { return(mimeInfo.Types.First()); } var match = _mimeRegex.Match(mime); if (!match.Success) { return(null); } return(match.Groups[1].Value); }