Changeset 11660
- Timestamp:
- 02/02/07 16:19:56 (2 years ago)
- Files:
-
- browser-extensions/NXIEHelper/trunk/NxIEHelperSetup/SvnDebug/NUXEO.CAB (modified) (previous)
- browser-extensions/NXIEHelper/trunk/NxIEHelperSetup/SvnDebug/Nuxeo-MSIEBrowserExtension.exe (modified) (previous)
- browser-extensions/NXIEHelper/trunk/NxIEHelperSetup/SvnDebug/Nuxeo-MSIEBrowserExtension.msi (modified) (previous)
- browser-extensions/NXIEHelper/trunk/NxIeHelper2/TransferOperation.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
browser-extensions/NXIEHelper/trunk/NxIeHelper2/TransferOperation.cs
r9498 r11660 6 6 using mshtml; 7 7 using System.IO; 8 using Microsoft.Win32; 8 9 9 10 namespace NxIEHelperNS … … 37 38 38 39 public static TransferOperation crtOperation; 39 public static int crtOpIdx = 0; 40 public static int crtOpIdx = 0; 41 42 public static string GetMimeTypeFromFilename(string fileName) 43 { 44 int dotPosition = fileName.LastIndexOf('.'); 45 if (dotPosition != -1) 46 { 47 string extension = fileName.Substring( dotPosition ).ToLower(); 48 RegistryKey key = Registry.ClassesRoot.OpenSubKey("MIME\\Database\\Content Type"); 49 50 string[] keyNames = key.GetSubKeyNames(); 51 foreach (string keyName in keyNames ) 52 { 53 RegistryKey temp = key.OpenSubKey(keyName); 54 if (extension.Equals(temp.GetValue("Extension"))) 55 return keyName; 56 } 57 } 58 return ""; 59 } 40 60 #endregion 41 61 … … 220 240 221 241 string content = sb.ToString(); 222 string mimeType = "application/octet-stream";242 string mimeType = GetMimeTypeFromFilename(fileName); 223 243 //string fileNameNoPath = fileName.Substring(fileName.LastIndexOf(sep) + 1); 224 244
