source: binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/MimeType.cs @ 133

Last change on this file since 133 was 133, checked in by alloc, 6 years ago

Fixes

File size: 23.6 KB
Line 
1using System;
2using System.Collections.Generic;
3
4namespace AllocsFixes.NetConnections.Servers.Web
5{
6        public class MimeType
7        {
8                private static IDictionary<string, string> _mappings = new Dictionary<string, string> (StringComparer.InvariantCultureIgnoreCase) {
9        {".323", "text/h323"},
10        {".3g2", "video/3gpp2"},
11        {".3gp", "video/3gpp"},
12        {".3gp2", "video/3gpp2"},
13        {".3gpp", "video/3gpp"},
14        {".7z", "application/x-7z-compressed"},
15        {".aa", "audio/audible"},
16        {".AAC", "audio/aac"},
17        {".aaf", "application/octet-stream"},
18        {".aax", "audio/vnd.audible.aax"},
19        {".ac3", "audio/ac3"},
20        {".aca", "application/octet-stream"},
21        {".accda", "application/msaccess.addin"},
22        {".accdb", "application/msaccess"},
23        {".accdc", "application/msaccess.cab"},
24        {".accde", "application/msaccess"},
25        {".accdr", "application/msaccess.runtime"},
26        {".accdt", "application/msaccess"},
27        {".accdw", "application/msaccess.webapplication"},
28        {".accft", "application/msaccess.ftemplate"},
29        {".acx", "application/internet-property-stream"},
30        {".AddIn", "text/xml"},
31        {".ade", "application/msaccess"},
32        {".adobebridge", "application/x-bridge-url"},
33        {".adp", "application/msaccess"},
34        {".ADT", "audio/vnd.dlna.adts"},
35        {".ADTS", "audio/aac"},
36        {".afm", "application/octet-stream"},
37        {".ai", "application/postscript"},
38        {".aif", "audio/x-aiff"},
39        {".aifc", "audio/aiff"},
40        {".aiff", "audio/aiff"},
41        {".air", "application/vnd.adobe.air-application-installer-package+zip"},
42        {".amc", "application/x-mpeg"},
43        {".application", "application/x-ms-application"},
44        {".art", "image/x-jg"},
45        {".asa", "application/xml"},
46        {".asax", "application/xml"},
47        {".ascx", "application/xml"},
48        {".asd", "application/octet-stream"},
49        {".asf", "video/x-ms-asf"},
50        {".ashx", "application/xml"},
51        {".asi", "application/octet-stream"},
52        {".asm", "text/plain"},
53        {".asmx", "application/xml"},
54        {".aspx", "application/xml"},
55        {".asr", "video/x-ms-asf"},
56        {".asx", "video/x-ms-asf"},
57        {".atom", "application/atom+xml"},
58        {".au", "audio/basic"},
59        {".avi", "video/x-msvideo"},
60        {".axs", "application/olescript"},
61        {".bas", "text/plain"},
62        {".bcpio", "application/x-bcpio"},
63        {".bin", "application/octet-stream"},
64        {".bmp", "image/bmp"},
65        {".c", "text/plain"},
66        {".cab", "application/octet-stream"},
67        {".caf", "audio/x-caf"},
68        {".calx", "application/vnd.ms-office.calx"},
69        {".cat", "application/vnd.ms-pki.seccat"},
70        {".cc", "text/plain"},
71        {".cd", "text/plain"},
72        {".cdda", "audio/aiff"},
73        {".cdf", "application/x-cdf"},
74        {".cer", "application/x-x509-ca-cert"},
75        {".chm", "application/octet-stream"},
76        {".class", "application/x-java-applet"},
77        {".clp", "application/x-msclip"},
78        {".cmx", "image/x-cmx"},
79        {".cnf", "text/plain"},
80        {".cod", "image/cis-cod"},
81        {".config", "application/xml"},
82        {".contact", "text/x-ms-contact"},
83        {".coverage", "application/xml"},
84        {".cpio", "application/x-cpio"},
85        {".cpp", "text/plain"},
86        {".crd", "application/x-mscardfile"},
87        {".crl", "application/pkix-crl"},
88        {".crt", "application/x-x509-ca-cert"},
89        {".cs", "text/plain"},
90        {".csdproj", "text/plain"},
91        {".csh", "application/x-csh"},
92        {".csproj", "text/plain"},
93        {".css", "text/css"},
94        {".csv", "text/csv"},
95        {".cur", "application/octet-stream"},
96        {".cxx", "text/plain"},
97        {".dat", "application/octet-stream"},
98        {".datasource", "application/xml"},
99        {".dbproj", "text/plain"},
100        {".dcr", "application/x-director"},
101        {".def", "text/plain"},
102        {".deploy", "application/octet-stream"},
103        {".der", "application/x-x509-ca-cert"},
104        {".dgml", "application/xml"},
105        {".dib", "image/bmp"},
106        {".dif", "video/x-dv"},
107        {".dir", "application/x-director"},
108        {".disco", "text/xml"},
109        {".dll", "application/x-msdownload"},
110        {".dll.config", "text/xml"},
111        {".dlm", "text/dlm"},
112        {".doc", "application/msword"},
113        {".docm", "application/vnd.ms-word.document.macroEnabled.12"},
114        {".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
115        {".dot", "application/msword"},
116        {".dotm", "application/vnd.ms-word.template.macroEnabled.12"},
117        {".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"},
118        {".dsp", "application/octet-stream"},
119        {".dsw", "text/plain"},
120        {".dtd", "text/xml"},
121        {".dtsConfig", "text/xml"},
122        {".dv", "video/x-dv"},
123        {".dvi", "application/x-dvi"},
124        {".dwf", "drawing/x-dwf"},
125        {".dwp", "application/octet-stream"},
126        {".dxr", "application/x-director"},
127        {".eml", "message/rfc822"},
128        {".emz", "application/octet-stream"},
129        {".eot", "application/octet-stream"},
130        {".eps", "application/postscript"},
131        {".etl", "application/etl"},
132        {".etx", "text/x-setext"},
133        {".evy", "application/envoy"},
134        {".exe", "application/octet-stream"},
135        {".exe.config", "text/xml"},
136        {".fdf", "application/vnd.fdf"},
137        {".fif", "application/fractals"},
138        {".filters", "Application/xml"},
139        {".fla", "application/octet-stream"},
140        {".flr", "x-world/x-vrml"},
141        {".flv", "video/x-flv"},
142        {".fsscript", "application/fsharp-script"},
143        {".fsx", "application/fsharp-script"},
144        {".generictest", "application/xml"},
145        {".gif", "image/gif"},
146        {".group", "text/x-ms-group"},
147        {".gsm", "audio/x-gsm"},
148        {".gtar", "application/x-gtar"},
149        {".gz", "application/x-gzip"},
150        {".h", "text/plain"},
151        {".hdf", "application/x-hdf"},
152        {".hdml", "text/x-hdml"},
153        {".hhc", "application/x-oleobject"},
154        {".hhk", "application/octet-stream"},
155        {".hhp", "application/octet-stream"},
156        {".hlp", "application/winhlp"},
157        {".hpp", "text/plain"},
158        {".hqx", "application/mac-binhex40"},
159        {".hta", "application/hta"},
160        {".htc", "text/x-component"},
161        {".htm", "text/html"},
162        {".html", "text/html"},
163        {".htt", "text/webviewhtml"},
164        {".hxa", "application/xml"},
165        {".hxc", "application/xml"},
166        {".hxd", "application/octet-stream"},
167        {".hxe", "application/xml"},
168        {".hxf", "application/xml"},
169        {".hxh", "application/octet-stream"},
170        {".hxi", "application/octet-stream"},
171        {".hxk", "application/xml"},
172        {".hxq", "application/octet-stream"},
173        {".hxr", "application/octet-stream"},
174        {".hxs", "application/octet-stream"},
175        {".hxt", "text/html"},
176        {".hxv", "application/xml"},
177        {".hxw", "application/octet-stream"},
178        {".hxx", "text/plain"},
179        {".i", "text/plain"},
180        {".ico", "image/x-icon"},
181        {".ics", "application/octet-stream"},
182        {".idl", "text/plain"},
183        {".ief", "image/ief"},
184        {".iii", "application/x-iphone"},
185        {".inc", "text/plain"},
186        {".inf", "application/octet-stream"},
187        {".inl", "text/plain"},
188        {".ins", "application/x-internet-signup"},
189        {".ipa", "application/x-itunes-ipa"},
190        {".ipg", "application/x-itunes-ipg"},
191        {".ipproj", "text/plain"},
192        {".ipsw", "application/x-itunes-ipsw"},
193        {".iqy", "text/x-ms-iqy"},
194        {".isp", "application/x-internet-signup"},
195        {".ite", "application/x-itunes-ite"},
196        {".itlp", "application/x-itunes-itlp"},
197        {".itms", "application/x-itunes-itms"},
198        {".itpc", "application/x-itunes-itpc"},
199        {".IVF", "video/x-ivf"},
200        {".jar", "application/java-archive"},
201        {".java", "application/octet-stream"},
202        {".jck", "application/liquidmotion"},
203        {".jcz", "application/liquidmotion"},
204        {".jfif", "image/pjpeg"},
205        {".jnlp", "application/x-java-jnlp-file"},
206        {".jpb", "application/octet-stream"},
207        {".jpe", "image/jpeg"},
208        {".jpeg", "image/jpeg"},
209        {".jpg", "image/jpeg"},
210        {".js", "application/x-javascript"},
211        {".jsx", "text/jscript"},
212        {".jsxbin", "text/plain"},
213        {".latex", "application/x-latex"},
214        {".library-ms", "application/windows-library+xml"},
215        {".lit", "application/x-ms-reader"},
216        {".loadtest", "application/xml"},
217        {".lpk", "application/octet-stream"},
218        {".lsf", "video/x-la-asf"},
219        {".lst", "text/plain"},
220        {".lsx", "video/x-la-asf"},
221        {".lzh", "application/octet-stream"},
222        {".m13", "application/x-msmediaview"},
223        {".m14", "application/x-msmediaview"},
224        {".m1v", "video/mpeg"},
225        {".m2t", "video/vnd.dlna.mpeg-tts"},
226        {".m2ts", "video/vnd.dlna.mpeg-tts"},
227        {".m2v", "video/mpeg"},
228        {".m3u", "audio/x-mpegurl"},
229        {".m3u8", "audio/x-mpegurl"},
230        {".m4a", "audio/m4a"},
231        {".m4b", "audio/m4b"},
232        {".m4p", "audio/m4p"},
233        {".m4r", "audio/x-m4r"},
234        {".m4v", "video/x-m4v"},
235        {".mac", "image/x-macpaint"},
236        {".mak", "text/plain"},
237        {".man", "application/x-troff-man"},
238        {".manifest", "application/x-ms-manifest"},
239        {".map", "text/plain"},
240        {".master", "application/xml"},
241        {".mda", "application/msaccess"},
242        {".mdb", "application/x-msaccess"},
243        {".mde", "application/msaccess"},
244        {".mdp", "application/octet-stream"},
245        {".me", "application/x-troff-me"},
246        {".mfp", "application/x-shockwave-flash"},
247        {".mht", "message/rfc822"},
248        {".mhtml", "message/rfc822"},
249        {".mid", "audio/mid"},
250        {".midi", "audio/mid"},
251        {".mix", "application/octet-stream"},
252        {".mk", "text/plain"},
253        {".mmf", "application/x-smaf"},
254        {".mno", "text/xml"},
255        {".mny", "application/x-msmoney"},
256        {".mod", "video/mpeg"},
257        {".mov", "video/quicktime"},
258        {".movie", "video/x-sgi-movie"},
259        {".mp2", "video/mpeg"},
260        {".mp2v", "video/mpeg"},
261        {".mp3", "audio/mpeg"},
262        {".mp4", "video/mp4"},
263        {".mp4v", "video/mp4"},
264        {".mpa", "video/mpeg"},
265        {".mpe", "video/mpeg"},
266        {".mpeg", "video/mpeg"},
267        {".mpf", "application/vnd.ms-mediapackage"},
268        {".mpg", "video/mpeg"},
269        {".mpp", "application/vnd.ms-project"},
270        {".mpv2", "video/mpeg"},
271        {".mqv", "video/quicktime"},
272        {".ms", "application/x-troff-ms"},
273        {".msi", "application/octet-stream"},
274        {".mso", "application/octet-stream"},
275        {".mts", "video/vnd.dlna.mpeg-tts"},
276        {".mtx", "application/xml"},
277        {".mvb", "application/x-msmediaview"},
278        {".mvc", "application/x-miva-compiled"},
279        {".mxp", "application/x-mmxp"},
280        {".nc", "application/x-netcdf"},
281        {".nsc", "video/x-ms-asf"},
282        {".nws", "message/rfc822"},
283        {".ocx", "application/octet-stream"},
284        {".oda", "application/oda"},
285        {".odc", "text/x-ms-odc"},
286        {".odh", "text/plain"},
287        {".odl", "text/plain"},
288        {".odp", "application/vnd.oasis.opendocument.presentation"},
289        {".ods", "application/oleobject"},
290        {".odt", "application/vnd.oasis.opendocument.text"},
291        {".one", "application/onenote"},
292        {".onea", "application/onenote"},
293        {".onepkg", "application/onenote"},
294        {".onetmp", "application/onenote"},
295        {".onetoc", "application/onenote"},
296        {".onetoc2", "application/onenote"},
297        {".orderedtest", "application/xml"},
298        {".osdx", "application/opensearchdescription+xml"},
299        {".p10", "application/pkcs10"},
300        {".p12", "application/x-pkcs12"},
301        {".p7b", "application/x-pkcs7-certificates"},
302        {".p7c", "application/pkcs7-mime"},
303        {".p7m", "application/pkcs7-mime"},
304        {".p7r", "application/x-pkcs7-certreqresp"},
305        {".p7s", "application/pkcs7-signature"},
306        {".pbm", "image/x-portable-bitmap"},
307        {".pcast", "application/x-podcast"},
308        {".pct", "image/pict"},
309        {".pcx", "application/octet-stream"},
310        {".pcz", "application/octet-stream"},
311        {".pdf", "application/pdf"},
312        {".pfb", "application/octet-stream"},
313        {".pfm", "application/octet-stream"},
314        {".pfx", "application/x-pkcs12"},
315        {".pgm", "image/x-portable-graymap"},
316        {".pic", "image/pict"},
317        {".pict", "image/pict"},
318        {".pkgdef", "text/plain"},
319        {".pkgundef", "text/plain"},
320        {".pko", "application/vnd.ms-pki.pko"},
321        {".pls", "audio/scpls"},
322        {".pma", "application/x-perfmon"},
323        {".pmc", "application/x-perfmon"},
324        {".pml", "application/x-perfmon"},
325        {".pmr", "application/x-perfmon"},
326        {".pmw", "application/x-perfmon"},
327        {".png", "image/png"},
328        {".pnm", "image/x-portable-anymap"},
329        {".pnt", "image/x-macpaint"},
330        {".pntg", "image/x-macpaint"},
331        {".pnz", "image/png"},
332        {".pot", "application/vnd.ms-powerpoint"},
333        {".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12"},
334        {".potx", "application/vnd.openxmlformats-officedocument.presentationml.template"},
335        {".ppa", "application/vnd.ms-powerpoint"},
336        {".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"},
337        {".ppm", "image/x-portable-pixmap"},
338        {".pps", "application/vnd.ms-powerpoint"},
339        {".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"},
340        {".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"},
341        {".ppt", "application/vnd.ms-powerpoint"},
342        {".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"},
343        {".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
344        {".prf", "application/pics-rules"},
345        {".prm", "application/octet-stream"},
346        {".prx", "application/octet-stream"},
347        {".ps", "application/postscript"},
348        {".psc1", "application/PowerShell"},
349        {".psd", "application/octet-stream"},
350        {".psess", "application/xml"},
351        {".psm", "application/octet-stream"},
352        {".psp", "application/octet-stream"},
353        {".pub", "application/x-mspublisher"},
354        {".pwz", "application/vnd.ms-powerpoint"},
355        {".qht", "text/x-html-insertion"},
356        {".qhtm", "text/x-html-insertion"},
357        {".qt", "video/quicktime"},
358        {".qti", "image/x-quicktime"},
359        {".qtif", "image/x-quicktime"},
360        {".qtl", "application/x-quicktimeplayer"},
361        {".qxd", "application/octet-stream"},
362        {".ra", "audio/x-pn-realaudio"},
363        {".ram", "audio/x-pn-realaudio"},
364        {".rar", "application/octet-stream"},
365        {".ras", "image/x-cmu-raster"},
366        {".rat", "application/rat-file"},
367        {".rc", "text/plain"},
368        {".rc2", "text/plain"},
369        {".rct", "text/plain"},
370        {".rdlc", "application/xml"},
371        {".resx", "application/xml"},
372        {".rf", "image/vnd.rn-realflash"},
373        {".rgb", "image/x-rgb"},
374        {".rgs", "text/plain"},
375        {".rm", "application/vnd.rn-realmedia"},
376        {".rmi", "audio/mid"},
377        {".rmp", "application/vnd.rn-rn_music_package"},
378        {".roff", "application/x-troff"},
379        {".rpm", "audio/x-pn-realaudio-plugin"},
380        {".rqy", "text/x-ms-rqy"},
381        {".rtf", "application/rtf"},
382        {".rtx", "text/richtext"},
383        {".ruleset", "application/xml"},
384        {".s", "text/plain"},
385        {".safariextz", "application/x-safari-safariextz"},
386        {".scd", "application/x-msschedule"},
387        {".sct", "text/scriptlet"},
388        {".sd2", "audio/x-sd2"},
389        {".sdp", "application/sdp"},
390        {".sea", "application/octet-stream"},
391        {".searchConnector-ms", "application/windows-search-connector+xml"},
392        {".setpay", "application/set-payment-initiation"},
393        {".setreg", "application/set-registration-initiation"},
394        {".settings", "application/xml"},
395        {".sgimb", "application/x-sgimb"},
396        {".sgml", "text/sgml"},
397        {".sh", "application/x-sh"},
398        {".shar", "application/x-shar"},
399        {".shtml", "text/html"},
400        {".sit", "application/x-stuffit"},
401        {".sitemap", "application/xml"},
402        {".skin", "application/xml"},
403        {".sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12"},
404        {".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"},
405        {".slk", "application/vnd.ms-excel"},
406        {".sln", "text/plain"},
407        {".slupkg-ms", "application/x-ms-license"},
408        {".smd", "audio/x-smd"},
409        {".smi", "application/octet-stream"},
410        {".smx", "audio/x-smd"},
411        {".smz", "audio/x-smd"},
412        {".snd", "audio/basic"},
413        {".snippet", "application/xml"},
414        {".snp", "application/octet-stream"},
415        {".sol", "text/plain"},
416        {".sor", "text/plain"},
417        {".spc", "application/x-pkcs7-certificates"},
418        {".spl", "application/futuresplash"},
419        {".src", "application/x-wais-source"},
420        {".srf", "text/plain"},
421        {".SSISDeploymentManifest", "text/xml"},
422        {".ssm", "application/streamingmedia"},
423        {".sst", "application/vnd.ms-pki.certstore"},
424        {".stl", "application/vnd.ms-pki.stl"},
425        {".sv4cpio", "application/x-sv4cpio"},
426        {".sv4crc", "application/x-sv4crc"},
427        {".svc", "application/xml"},
428        {".swf", "application/x-shockwave-flash"},
429        {".t", "application/x-troff"},
430        {".tar", "application/x-tar"},
431        {".tcl", "application/x-tcl"},
432        {".testrunconfig", "application/xml"},
433        {".testsettings", "application/xml"},
434        {".tex", "application/x-tex"},
435        {".texi", "application/x-texinfo"},
436        {".texinfo", "application/x-texinfo"},
437        {".tgz", "application/x-compressed"},
438        {".thmx", "application/vnd.ms-officetheme"},
439        {".thn", "application/octet-stream"},
440        {".tif", "image/tiff"},
441        {".tiff", "image/tiff"},
442        {".tlh", "text/plain"},
443        {".tli", "text/plain"},
444        {".toc", "application/octet-stream"},
445        {".tr", "application/x-troff"},
446        {".trm", "application/x-msterminal"},
447        {".trx", "application/xml"},
448        {".ts", "video/vnd.dlna.mpeg-tts"},
449        {".tsv", "text/tab-separated-values"},
450        {".ttf", "application/octet-stream"},
451        {".tts", "video/vnd.dlna.mpeg-tts"},
452        {".txt", "text/plain"},
453        {".u32", "application/octet-stream"},
454        {".uls", "text/iuls"},
455        {".user", "text/plain"},
456        {".ustar", "application/x-ustar"},
457        {".vb", "text/plain"},
458        {".vbdproj", "text/plain"},
459        {".vbk", "video/mpeg"},
460        {".vbproj", "text/plain"},
461        {".vbs", "text/vbscript"},
462        {".vcf", "text/x-vcard"},
463        {".vcproj", "Application/xml"},
464        {".vcs", "text/plain"},
465        {".vcxproj", "Application/xml"},
466        {".vddproj", "text/plain"},
467        {".vdp", "text/plain"},
468        {".vdproj", "text/plain"},
469        {".vdx", "application/vnd.ms-visio.viewer"},
470        {".vml", "text/xml"},
471        {".vscontent", "application/xml"},
472        {".vsct", "text/xml"},
473        {".vsd", "application/vnd.visio"},
474        {".vsi", "application/ms-vsi"},
475        {".vsix", "application/vsix"},
476        {".vsixlangpack", "text/xml"},
477        {".vsixmanifest", "text/xml"},
478        {".vsmdi", "application/xml"},
479        {".vspscc", "text/plain"},
480        {".vss", "application/vnd.visio"},
481        {".vsscc", "text/plain"},
482        {".vssettings", "text/xml"},
483        {".vssscc", "text/plain"},
484        {".vst", "application/vnd.visio"},
485        {".vstemplate", "text/xml"},
486        {".vsto", "application/x-ms-vsto"},
487        {".vsw", "application/vnd.visio"},
488        {".vsx", "application/vnd.visio"},
489        {".vtx", "application/vnd.visio"},
490        {".wav", "audio/wav"},
491        {".wave", "audio/wav"},
492        {".wax", "audio/x-ms-wax"},
493        {".wbk", "application/msword"},
494        {".wbmp", "image/vnd.wap.wbmp"},
495        {".wcm", "application/vnd.ms-works"},
496        {".wdb", "application/vnd.ms-works"},
497        {".wdp", "image/vnd.ms-photo"},
498        {".webarchive", "application/x-safari-webarchive"},
499        {".webtest", "application/xml"},
500        {".wiq", "application/xml"},
501        {".wiz", "application/msword"},
502        {".wks", "application/vnd.ms-works"},
503        {".WLMP", "application/wlmoviemaker"},
504        {".wlpginstall", "application/x-wlpg-detect"},
505        {".wlpginstall3", "application/x-wlpg3-detect"},
506        {".wm", "video/x-ms-wm"},
507        {".wma", "audio/x-ms-wma"},
508        {".wmd", "application/x-ms-wmd"},
509        {".wmf", "application/x-msmetafile"},
510        {".wml", "text/vnd.wap.wml"},
511        {".wmlc", "application/vnd.wap.wmlc"},
512        {".wmls", "text/vnd.wap.wmlscript"},
513        {".wmlsc", "application/vnd.wap.wmlscriptc"},
514        {".wmp", "video/x-ms-wmp"},
515        {".wmv", "video/x-ms-wmv"},
516        {".wmx", "video/x-ms-wmx"},
517        {".wmz", "application/x-ms-wmz"},
518        {".wpl", "application/vnd.ms-wpl"},
519        {".wps", "application/vnd.ms-works"},
520        {".wri", "application/x-mswrite"},
521        {".wrl", "x-world/x-vrml"},
522        {".wrz", "x-world/x-vrml"},
523        {".wsc", "text/scriptlet"},
524        {".wsdl", "text/xml"},
525        {".wvx", "video/x-ms-wvx"},
526        {".x", "application/directx"},
527        {".xaf", "x-world/x-vrml"},
528        {".xaml", "application/xaml+xml"},
529        {".xap", "application/x-silverlight-app"},
530        {".xbap", "application/x-ms-xbap"},
531        {".xbm", "image/x-xbitmap"},
532        {".xdr", "text/plain"},
533        {".xht", "application/xhtml+xml"},
534        {".xhtml", "application/xhtml+xml"},
535        {".xla", "application/vnd.ms-excel"},
536        {".xlam", "application/vnd.ms-excel.addin.macroEnabled.12"},
537        {".xlc", "application/vnd.ms-excel"},
538        {".xld", "application/vnd.ms-excel"},
539        {".xlk", "application/vnd.ms-excel"},
540        {".xll", "application/vnd.ms-excel"},
541        {".xlm", "application/vnd.ms-excel"},
542        {".xls", "application/vnd.ms-excel"},
543        {".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"},
544        {".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"},
545        {".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
546        {".xlt", "application/vnd.ms-excel"},
547        {".xltm", "application/vnd.ms-excel.template.macroEnabled.12"},
548        {".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"},
549        {".xlw", "application/vnd.ms-excel"},
550        {".xml", "text/xml"},
551        {".xmta", "application/xml"},
552        {".xof", "x-world/x-vrml"},
553        {".XOML", "text/plain"},
554        {".xpm", "image/x-xpixmap"},
555        {".xps", "application/vnd.ms-xpsdocument"},
556        {".xrm-ms", "text/xml"},
557        {".xsc", "application/xml"},
558        {".xsd", "text/xml"},
559        {".xsf", "text/xml"},
560        {".xsl", "text/xml"},
561        {".xslt", "text/xml"},
562        {".xsn", "application/octet-stream"},
563        {".xss", "application/xml"},
564        {".xtp", "application/octet-stream"},
565        {".xwd", "image/x-xwindowdump"},
566        {".z", "application/x-compress"},
567        {".zip", "application/x-zip-compressed"},
568        };
569
570                public static string GetMimeType (string extension)
571                {
572                        if (extension == null) {
573                                throw new ArgumentNullException ("extension");
574                        }
575
576                        if (!extension.StartsWith (".")) {
577                                extension = "." + extension;
578                        }
579
580                        string mime;
581
582                        return _mappings.TryGetValue (extension, out mime) ? mime : "application/octet-stream";
583                }
584        }
585}
586
Note: See TracBrowser for help on using the repository browser.