ContentTypeDict.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace HTEXLib.COMM.Helpers
  5. {
  6. public static class ContentTypeDict
  7. {
  8. public static readonly Dictionary<string, string> extdict = new Dictionary<string, string> {
  9. //{ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".xlsx"},
  10. { "audio/x-ms-wma",".wma"},
  11. {"video/3gpp",".3g2"},
  12. {"audio/mp4",".aac"},
  13. {"audio/ac3",".ac3"},
  14. {"text/x-adasrc",".adb"},
  15. {"image/x-applix-graphics",".ag"},
  16. {"audio/amr",".amr"},
  17. {"audio/x-ape",".ape"},
  18. {"image/x-sony-arw",".arw"},
  19. {"text/plain",".asc"},
  20. {"video/x-ms-asf",".asf"},
  21. {"text/x-ssa",".ass"},
  22. {"video/x-msvideo",".avi"},
  23. {"text/x-bibtex",".bib"},
  24. {"image/bmp",".bmp"},
  25. {"text/x-csrc",".c"},
  26. {"text/x-c++src",".c++"},
  27. {"image/cgm",".cgm"},
  28. {"text/x-tex",".cls"},
  29. {"text/x-cmake",".cmake"},
  30. {"image/x-canon-cr2",".cr2"},
  31. {"image/x-canon-crw",".crw"},
  32. {"text/x-csharp",".cs"},
  33. {"text/css",".css"},
  34. {"text/csv",".csv"},
  35. {"image/x-win-bitmap",".cur"},
  36. {"text/x-dsrc",".d"},
  37. {"text/x-dcl",".dcl"},
  38. {"image/x-kodak-dcr",".dcr"},
  39. {"image/x-dds",".dds"},
  40. {"text/x-patch",".diff"},
  41. {"image/vnd.djvu",".djv"},
  42. {"image/x-adobe-dng",".dng"},
  43. {"text/vnd.graphviz",".dot"},
  44. {"text/x-dsl",".dsl"},
  45. {"image/vnd.dwg",".dwg"},
  46. {"image/vnd.dxf",".dxf"},
  47. {"text/x-eiffel",".e"},
  48. {"text/x-emacs-lisp",".el"},
  49. {"image/x-emf",".emf"},
  50. {"image/x-eps",".eps"},
  51. {"image/x-bzeps",".eps.bz2"},
  52. {"image/x-gzeps",".eps.gz"},
  53. {"text/x-erlang",".erl"},
  54. {"text/x-setext",".etx"},
  55. {"image/x-exr",".exr"},
  56. {"text/x-fortran",".f"},
  57. {"image/x-xfig",".fig"},
  58. {"image/fits",".fits"},
  59. {"video/x-flv",".flv"},
  60. {"text/x-xslfo",".fo"},
  61. {"image/fax-g3",".g3"},
  62. {"text/directory",".gcrd"},
  63. {"image/gif",".gif"},
  64. {"text/x-google-video-pointer",".gvp"},
  65. {"text/x-chdr",".h"},
  66. {"text/x-c++hdr",".h++"},
  67. {"text/x-haskell",".hs"},
  68. {"text/html",".htm"},
  69. {"image/x-tga",".icb"},
  70. {"image/x-icns",".icns"},
  71. {"image/x-icon",".ico"},
  72. {"text/calendar",".ics"},
  73. {"text/x-idl",".idl"},
  74. {"image/ief",".ief"},
  75. {"image/x-iff",".iff"},
  76. {"image/x-ilbm",".ilbm"},
  77. {"text/x-imelody",".ime"},
  78. {"text/x-iptables",".iptables"},
  79. {"image/jp2",".j2k"},
  80. {"text/vnd.sun.j2me.app-descriptor",".jad"},
  81. {"text/x-java",".java"},
  82. {"image/x-jng",".jng"},
  83. {"image/jpeg",".jpeg"},
  84. {"application/javascript",".js"},
  85. {"application/json",".json"},
  86. {"application/jsonp",".jsonp"},
  87. {"image/x-kodak-k25",".k25"},
  88. {"image/x-kodak-kdc",".kdc"},
  89. {"text/x-ldif",".ldif"},
  90. {"text/x-literate-haskell",".lhs"},
  91. {"text/x-log",".log"},
  92. {"text/x-lua",".lua"},
  93. {"image/x-lwo",".lwo"},
  94. {"image/x-lws",".lws"},
  95. {"text/x-lilypond",".ly"},
  96. {"text/x-matlab",".m"},
  97. {"video/mpeg",".m2t"},
  98. {"audio/x-mpegurl",".m3u"},
  99. {"application/vnd.apple.mpegurl",".m3u8"},
  100. {"text/x-troff-me",".me"},
  101. {"video/x-matroska",".mkv"},
  102. {"text/x-ocaml",".ml"},
  103. {"text/x-troff-mm",".mm"},
  104. {"text/mathml",".mml"},
  105. {"text/x-moc",".moc"},
  106. {"text/x-mof",".mof"},
  107. {"audio/mpeg",".mp3"},
  108. {"video/mp4",".mp4"},
  109. {"text/x-mrml",".mrl"},
  110. {"image/x-minolta-mrw",".mrw"},
  111. {"text/x-troff-ms",".ms"},
  112. {"image/x-msod",".msod"},
  113. {"text/x-mup",".mup"},
  114. {"image/x-nikon-nef",".nef"},
  115. {"text/x-nfo",".nfo"},
  116. {"text/x-ocl",".ocl"},
  117. {"text/x-opml+xml",".opml"},
  118. {"image/openraster",".ora"},
  119. {"image/x-olympus-orf",".orf"},
  120. {"text/x-pascal",".p"},
  121. {"image/x-portable-bitmap",".pbm"},
  122. {"image/x-photo-cd",".pcd"},
  123. {"image/x-pcx",".pcx"},
  124. {"application/pdf",".pdf"},
  125. {"image/x-pentax-pef",".pef"},
  126. {"image/x-portable-graymap",".pgm"},
  127. {"image/x-pict",".pict"},
  128. {"image/png",".png"},
  129. {"image/x-portable-anymap",".pnm"},
  130. {"image/x-macpaint",".pntg"},
  131. {"text/x-gettext-translation",".po"},
  132. {"text/x-gettext-translation-template",".pot"},
  133. {"text/x-python",".py"},
  134. {"image/x-quicktime",".qif"},
  135. {"image/x-fuji-raf",".raf"},
  136. {"image/x-cmu-raster",".ras"},
  137. {"image/x-panasonic-raw",".raw"},
  138. {"text/x-ms-regedit",".reg"},
  139. {"image/x-rgb",".rgb"},
  140. {"image/rle",".rle"},
  141. {"text/troff",".roff"},
  142. {"image/vnd.rn-realpix",".rp"},
  143. {"text/vnd.rn-realtext",".rt"},
  144. {"text/richtext",".rtx"},
  145. {"text/x-scheme",".scm"},
  146. {"image/x-sgi",".sgi"},
  147. {"text/sgml",".sgm"},
  148. {"image/x-skencil",".sk"},
  149. {"text/spreadsheet",".slk"},
  150. {"text/x-rpm-spec",".spec"},
  151. {"text/x-sql",".sql"},
  152. {"image/x-sony-sr2",".sr2"},
  153. {"image/x-sony-srf",".srf"},
  154. {"text/x-subviewer",".sub"},
  155. {"image/x-sun-raster",".sun"},
  156. {"image/svg+xml",".svg"},
  157. {"image/svg+xml-compressed",".svgz"},
  158. {"text/x-txt2tags",".t2t"},
  159. {"text/x-tcl",".tcl"},
  160. {"text/x-texinfo",".texi"},
  161. {"image/tiff",".tif"},
  162. {"audio/x-voc",".voc"},
  163. {"image/x-wmf",".wmf"},
  164. {"text/vnd.wap.wml",".wml"},
  165. {"text/vnd.wap.wmlscript",".wmls"},
  166. {"video/x-ms-wmv",".wmv"},
  167. {"application/xhtml+xml",".xhtml"},
  168. {"application/xml",".xml"}
  169. };
  170. public static readonly Dictionary<string, string> dict = new Dictionary<string, string> {
  171. {".3g2", "video/3gpp"},
  172. {".3ga", "video/3gpp"},
  173. {".3gp", "video/3gpp"},
  174. {".aac", "audio/mp4"},
  175. {".ac3", "audio/ac3"},
  176. {".adb", "text/x-adasrc"},
  177. {".ads", "text/x-adasrc"},
  178. {".ag", "image/x-applix-graphics"},
  179. {".amr", "audio/amr"},
  180. {".ape", "audio/x-ape"},
  181. {".arw", "image/x-sony-arw"},
  182. {".asc", "text/plain"},
  183. {".asf", "video/x-ms-asf"},
  184. {".ass", "text/x-ssa"},
  185. {".avi", "video/x-msvideo"},
  186. {".bib", "text/x-bibtex"},
  187. {".bmp", "image/bmp"},
  188. {".c", "text/x-csrc"},
  189. {".c++", "text/x-c++src"},
  190. {".cc", "text/x-c++src"},
  191. {".cgm", "image/cgm"},
  192. {".cls", "text/x-tex"},
  193. {".cmake", "text/x-cmake"},
  194. {".cpp", "text/x-c++src"},
  195. {".cr2", "image/x-canon-cr2"},
  196. {".crw", "image/x-canon-crw"},
  197. {".cs", "text/x-csharp"},
  198. {".css", "text/css"},
  199. {".cssl", "text/css"},
  200. {".csv", "text/csv"},
  201. {".cur", "image/x-win-bitmap"},
  202. {".cxx", "text/x-c++src"},
  203. {".d", "text/x-dsrc"},
  204. {".dcl", "text/x-dcl"},
  205. {".dcr", "image/x-kodak-dcr"},
  206. {".dds", "image/x-dds"},
  207. {".diff", "text/x-patch"},
  208. {".djv", "image/vnd.djvu"},
  209. {".djvu", "image/vnd.djvu"},
  210. {".dng", "image/x-adobe-dng"},
  211. {".dot", "text/vnd.graphviz"},
  212. {".dsl", "text/x-dsl"},
  213. {".dtx", "text/x-tex"},
  214. {".dwg", "image/vnd.dwg"},
  215. {".dxf", "image/vnd.dxf"},
  216. {".e", "text/x-eiffel"},
  217. {".eif", "text/x-eiffel"},
  218. {".el", "text/x-emacs-lisp"},
  219. {".emf", "image/x-emf"},
  220. {".eps", "image/x-eps"},
  221. {".eps.bz2", "image/x-bzeps"},
  222. {".eps.gz", "image/x-gzeps"},
  223. {".epsf", "image/x-eps"},
  224. {".epsf.bz2", "image/x-bzeps"},
  225. {".epsf.gz", "image/x-gzeps"},
  226. {".epsi", "image/x-eps"},
  227. {".epsi.bz2", "image/x-bzeps"},
  228. {".epsi.gz", "image/x-gzeps"},
  229. {".erl", "text/x-erlang"},
  230. {".etx", "text/x-setext"},
  231. {".exr", "image/x-exr"},
  232. {".f", "text/x-fortran"},
  233. {".f90", "text/x-fortran"},
  234. {".f95", "text/x-fortran"},
  235. {".fig", "image/x-xfig"},
  236. {".fits", "image/fits"},
  237. {".flv", "video/x-flv"},
  238. {".fo", "text/x-xslfo"},
  239. {".for", "text/x-fortran"},
  240. {".g3", "image/fax-g3"},
  241. {".gcrd", "text/directory"},
  242. {".gif", "image/gif"},
  243. {".gv", "text/vnd.graphviz"},
  244. {".gvp", "text/x-google-video-pointer"},
  245. {".h", "text/x-chdr"},
  246. {".h++", "text/x-c++hdr"},
  247. {".hh", "text/x-c++hdr"},
  248. {".hp", "text/x-c++hdr"},
  249. {".hpp", "text/x-c++hdr"},
  250. {".hs", "text/x-haskell"},
  251. {".htm", "text/html"},
  252. {".html", "text/html"},
  253. {".hxx", "text/x-c++hdr"},
  254. {".icb", "image/x-tga"},
  255. {".icns", "image/x-icns"},
  256. {".ico", "image/x-icon"},
  257. {".ics", "text/calendar"},
  258. {".idl", "text/x-idl"},
  259. {".ief", "image/ief"},
  260. {".iff", "image/x-iff"},
  261. {".ilbm", "image/x-ilbm"},
  262. {".ime", "text/x-imelody"},
  263. {".imy", "text/x-imelody"},
  264. {".ins", "text/x-tex"},
  265. {".iptables", "text/x-iptables"},
  266. {".j2k", "image/jp2"},
  267. {".jad", "text/vnd.sun.j2me.app-descriptor"},
  268. {".java", "text/x-java"},
  269. {".jng", "image/x-jng"},
  270. {".jp2", "image/jp2"},
  271. {".jpc", "image/jp2"},
  272. {".jpe", "image/jpeg"},
  273. {".jpeg", "image/jpeg"},
  274. {".jpf", "image/jp2"},
  275. {".jpg", "image/jpeg"},
  276. {".jpx", "image/jp2"},
  277. {".js", "application/javascript"},
  278. {".json", "application/json"},
  279. {".jsonp", "application/jsonp"},
  280. {".k25", "image/x-kodak-k25"},
  281. {".kdc", "image/x-kodak-kdc"},
  282. {".latex", "text/x-tex"},
  283. {".ldif", "text/x-ldif"},
  284. {".lhs", "text/x-literate-haskell"},
  285. {".log", "text/x-log"},
  286. {".ltx", "text/x-tex"},
  287. {".lua", "text/x-lua"},
  288. {".lwo", "image/x-lwo"},
  289. {".lwob", "image/x-lwo"},
  290. {".lws", "image/x-lws"},
  291. {".ly", "text/x-lilypond"},
  292. {".m", "text/x-matlab"},
  293. {".m2t", "video/mpeg"},
  294. {".m3u", "audio/x-mpegurl"},
  295. {".m3u8", "application/vnd.apple.mpegurl"},
  296. {".me", "text/x-troff-me"},
  297. {".mkv", "video/x-matroska"},
  298. {".ml", "text/x-ocaml"},
  299. {".mli", "text/x-ocaml"},
  300. {".mm", "text/x-troff-mm"},
  301. {".mml", "text/mathml"},
  302. {".moc", "text/x-moc"},
  303. {".mof", "text/x-mof"},
  304. {".mp2", "video/mpeg"},
  305. {".mp3", "audio/mpeg"},
  306. {".mp4", "video/mp4"},
  307. {".mpe", "video/mpeg"},
  308. {".mpeg", "video/mpeg"},
  309. {".mpg", "video/mpeg"},
  310. {".mrl", "text/x-mrml"},
  311. {".mrml", "text/x-mrml"},
  312. {".mrw", "image/x-minolta-mrw"},
  313. {".ms", "text/x-troff-ms"},
  314. {".msod", "image/x-msod"},
  315. {".mup", "text/x-mup"},
  316. {".nef", "image/x-nikon-nef"},
  317. {".nfo", "text/x-nfo"},
  318. {".not", "text/x-mup"},
  319. {".ocl", "text/x-ocl"},
  320. {".opml", "text/x-opml+xml"},
  321. {".ora", "image/openraster"},
  322. {".orf", "image/x-olympus-orf"},
  323. {".p", "text/x-pascal"},
  324. {".pas", "text/x-pascal"},
  325. {".patch", "text/x-patch"},
  326. {".pbm", "image/x-portable-bitmap"},
  327. {".pcd", "image/x-photo-cd"},
  328. {".pcx", "image/x-pcx"},
  329. {".pdf", "application/pdf"},
  330. {".pef", "image/x-pentax-pef"},
  331. {".pgm", "image/x-portable-graymap"},
  332. {".pict", "image/x-pict"},
  333. {".pict1", "image/x-pict"},
  334. {".pict2", "image/x-pict"},
  335. {".png", "image/png"},
  336. {".pnm", "image/x-portable-anymap"},
  337. {".pntg", "image/x-macpaint"},
  338. {".po", "text/x-gettext-translation"},
  339. {".pot", "text/x-gettext-translation-template"},
  340. {".py", "text/x-python"},
  341. {".qif", "image/x-quicktime"},
  342. {".qtif", "image/x-quicktime"},
  343. {".raf", "image/x-fuji-raf"},
  344. {".ras", "image/x-cmu-raster"},
  345. {".raw", "image/x-panasonic-raw"},
  346. {".reg", "text/x-ms-regedit"},
  347. {".rgb", "image/x-rgb"},
  348. {".rle", "image/rle"},
  349. {".roff", "text/troff"},
  350. {".rp", "image/vnd.rn-realpix"},
  351. {".rt", "text/vnd.rn-realtext"},
  352. {".rtx", "text/richtext"},
  353. {".scm", "text/x-scheme"},
  354. {".sgi", "image/x-sgi"},
  355. {".sgm", "text/sgml"},
  356. {".sgml", "text/sgml"},
  357. {".sk", "image/x-skencil"},
  358. {".sk1", "image/x-skencil"},
  359. {".slk", "text/spreadsheet"},
  360. {".spec", "text/x-rpm-spec"},
  361. {".sql", "text/x-sql"},
  362. {".sr2", "image/x-sony-sr2"},
  363. {".srf", "image/x-sony-srf"},
  364. {".ssa", "text/x-ssa"},
  365. {".sty", "text/x-tex"},
  366. {".sub", "text/x-subviewer"},
  367. {".sun", "image/x-sun-raster"},
  368. {".svg", "image/svg+xml"},
  369. {".svgz", "image/svg+xml-compressed"},
  370. {".sylk", "text/spreadsheet"},
  371. {".t2t", "text/x-txt2tags"},
  372. {".tcl", "text/x-tcl"},
  373. {".tex", "text/x-tex"},
  374. {".texi", "text/x-texinfo"},
  375. {".texinfo", "text/x-texinfo"},
  376. {".tga", "image/x-tga"},
  377. {".tif", "image/tiff"},
  378. {".tiff", "image/tiff"},
  379. {".tk", "text/x-tcl"},
  380. {".tpic", "image/x-tga"},
  381. {".tr", "text/troff"},
  382. {".txt", "text/plain"},
  383. {".vob", "video/mpeg"},
  384. {".voc", "audio/x-voc"},
  385. {".wmf", "image/x-wmf"},
  386. {".wml", "text/vnd.wap.wml"},
  387. {".wmls", "text/vnd.wap.wmlscript"},
  388. {".wmv", "video/x-ms-wmv"},
  389. {".xhtml", "application/xhtml+xml"},
  390. {".xml", "application/xml"}
  391. };
  392. }
  393. }