AcManager.LargeFilesSharing.FileUploaderBase.GetMimeType C# (CSharp) Method

GetMimeType() protected static method

protected static GetMimeType ( string filename ) : string
filename string
return string
        protected static string GetMimeType(string filename) {
            var ext = Path.GetExtension(filename)?.ToLower();
            if (ext != null) {
                var regKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext);
                if (regKey?.GetValue("Content Type") != null) {
                    return regKey.GetValue("Content Type").ToString();
                }
            }

            return @"application/unknown";
        }