mime.rb 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. module Rack
  2. module Mime
  3. # Returns String with mime type if found, otherwise use +fallback+.
  4. # +ext+ should be filename extension in the '.ext' format that
  5. # File.extname(file) returns.
  6. # +fallback+ may be any object
  7. #
  8. # Also see the documentation for MIME_TYPES
  9. #
  10. # Usage:
  11. # Rack::Mime.mime_type('.foo')
  12. #
  13. # This is a shortcut for:
  14. # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')
  15. def mime_type(ext, fallback='application/octet-stream')
  16. MIME_TYPES.fetch(ext.to_s.downcase, fallback)
  17. end
  18. module_function :mime_type
  19. # List of most common mime-types, selected various sources
  20. # according to their usefulness in a webserving scope for Ruby
  21. # users.
  22. #
  23. # To amend this list with your local mime.types list you can use:
  24. #
  25. # require 'webrick/httputils'
  26. # list = WEBrick::HTTPUtils.load_mime_types('/etc/mime.types')
  27. # Rack::Mime::MIME_TYPES.merge!(list)
  28. #
  29. # N.B. On Ubuntu the mime.types file does not include the leading period, so
  30. # users may need to modify the data before merging into the hash.
  31. #
  32. # To add the list mongrel provides, use:
  33. #
  34. # require 'mongrel/handlers'
  35. # Rack::Mime::MIME_TYPES.merge!(Mongrel::DirHandler::MIME_TYPES)
  36. MIME_TYPES = {
  37. ".123" => "application/vnd.lotus-1-2-3",
  38. ".3dml" => "text/vnd.in3d.3dml",
  39. ".3g2" => "video/3gpp2",
  40. ".3gp" => "video/3gpp",
  41. ".a" => "application/octet-stream",
  42. ".acc" => "application/vnd.americandynamics.acc",
  43. ".ace" => "application/x-ace-compressed",
  44. ".acu" => "application/vnd.acucobol",
  45. ".aep" => "application/vnd.audiograph",
  46. ".afp" => "application/vnd.ibm.modcap",
  47. ".ai" => "application/postscript",
  48. ".aif" => "audio/x-aiff",
  49. ".aiff" => "audio/x-aiff",
  50. ".ami" => "application/vnd.amiga.ami",
  51. ".appcache" => "text/cache-manifest",
  52. ".apr" => "application/vnd.lotus-approach",
  53. ".asc" => "application/pgp-signature",
  54. ".asf" => "video/x-ms-asf",
  55. ".asm" => "text/x-asm",
  56. ".aso" => "application/vnd.accpac.simply.aso",
  57. ".asx" => "video/x-ms-asf",
  58. ".atc" => "application/vnd.acucorp",
  59. ".atom" => "application/atom+xml",
  60. ".atomcat" => "application/atomcat+xml",
  61. ".atomsvc" => "application/atomsvc+xml",
  62. ".atx" => "application/vnd.antix.game-component",
  63. ".au" => "audio/basic",
  64. ".avi" => "video/x-msvideo",
  65. ".bat" => "application/x-msdownload",
  66. ".bcpio" => "application/x-bcpio",
  67. ".bdm" => "application/vnd.syncml.dm+wbxml",
  68. ".bh2" => "application/vnd.fujitsu.oasysprs",
  69. ".bin" => "application/octet-stream",
  70. ".bmi" => "application/vnd.bmi",
  71. ".bmp" => "image/bmp",
  72. ".box" => "application/vnd.previewsystems.box",
  73. ".btif" => "image/prs.btif",
  74. ".bz" => "application/x-bzip",
  75. ".bz2" => "application/x-bzip2",
  76. ".c" => "text/x-c",
  77. ".c4g" => "application/vnd.clonk.c4group",
  78. ".cab" => "application/vnd.ms-cab-compressed",
  79. ".cc" => "text/x-c",
  80. ".ccxml" => "application/ccxml+xml",
  81. ".cdbcmsg" => "application/vnd.contact.cmsg",
  82. ".cdkey" => "application/vnd.mediastation.cdkey",
  83. ".cdx" => "chemical/x-cdx",
  84. ".cdxml" => "application/vnd.chemdraw+xml",
  85. ".cdy" => "application/vnd.cinderella",
  86. ".cer" => "application/pkix-cert",
  87. ".cgm" => "image/cgm",
  88. ".chat" => "application/x-chat",
  89. ".chm" => "application/vnd.ms-htmlhelp",
  90. ".chrt" => "application/vnd.kde.kchart",
  91. ".cif" => "chemical/x-cif",
  92. ".cii" => "application/vnd.anser-web-certificate-issue-initiation",
  93. ".cil" => "application/vnd.ms-artgalry",
  94. ".cla" => "application/vnd.claymore",
  95. ".class" => "application/octet-stream",
  96. ".clkk" => "application/vnd.crick.clicker.keyboard",
  97. ".clkp" => "application/vnd.crick.clicker.palette",
  98. ".clkt" => "application/vnd.crick.clicker.template",
  99. ".clkw" => "application/vnd.crick.clicker.wordbank",
  100. ".clkx" => "application/vnd.crick.clicker",
  101. ".clp" => "application/x-msclip",
  102. ".cmc" => "application/vnd.cosmocaller",
  103. ".cmdf" => "chemical/x-cmdf",
  104. ".cml" => "chemical/x-cml",
  105. ".cmp" => "application/vnd.yellowriver-custom-menu",
  106. ".cmx" => "image/x-cmx",
  107. ".com" => "application/x-msdownload",
  108. ".conf" => "text/plain",
  109. ".cpio" => "application/x-cpio",
  110. ".cpp" => "text/x-c",
  111. ".cpt" => "application/mac-compactpro",
  112. ".crd" => "application/x-mscardfile",
  113. ".crl" => "application/pkix-crl",
  114. ".crt" => "application/x-x509-ca-cert",
  115. ".csh" => "application/x-csh",
  116. ".csml" => "chemical/x-csml",
  117. ".csp" => "application/vnd.commonspace",
  118. ".css" => "text/css",
  119. ".csv" => "text/csv",
  120. ".curl" => "application/vnd.curl",
  121. ".cww" => "application/prs.cww",
  122. ".cxx" => "text/x-c",
  123. ".daf" => "application/vnd.mobius.daf",
  124. ".davmount" => "application/davmount+xml",
  125. ".dcr" => "application/x-director",
  126. ".dd2" => "application/vnd.oma.dd2+xml",
  127. ".ddd" => "application/vnd.fujixerox.ddd",
  128. ".deb" => "application/x-debian-package",
  129. ".der" => "application/x-x509-ca-cert",
  130. ".dfac" => "application/vnd.dreamfactory",
  131. ".diff" => "text/x-diff",
  132. ".dis" => "application/vnd.mobius.dis",
  133. ".djv" => "image/vnd.djvu",
  134. ".djvu" => "image/vnd.djvu",
  135. ".dll" => "application/x-msdownload",
  136. ".dmg" => "application/octet-stream",
  137. ".dna" => "application/vnd.dna",
  138. ".doc" => "application/msword",
  139. ".docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  140. ".dot" => "application/msword",
  141. ".dp" => "application/vnd.osgi.dp",
  142. ".dpg" => "application/vnd.dpgraph",
  143. ".dsc" => "text/prs.lines.tag",
  144. ".dtd" => "application/xml-dtd",
  145. ".dts" => "audio/vnd.dts",
  146. ".dtshd" => "audio/vnd.dts.hd",
  147. ".dv" => "video/x-dv",
  148. ".dvi" => "application/x-dvi",
  149. ".dwf" => "model/vnd.dwf",
  150. ".dwg" => "image/vnd.dwg",
  151. ".dxf" => "image/vnd.dxf",
  152. ".dxp" => "application/vnd.spotfire.dxp",
  153. ".ear" => "application/java-archive",
  154. ".ecelp4800" => "audio/vnd.nuera.ecelp4800",
  155. ".ecelp7470" => "audio/vnd.nuera.ecelp7470",
  156. ".ecelp9600" => "audio/vnd.nuera.ecelp9600",
  157. ".ecma" => "application/ecmascript",
  158. ".edm" => "application/vnd.novadigm.edm",
  159. ".edx" => "application/vnd.novadigm.edx",
  160. ".efif" => "application/vnd.picsel",
  161. ".ei6" => "application/vnd.pg.osasli",
  162. ".eml" => "message/rfc822",
  163. ".eol" => "audio/vnd.digital-winds",
  164. ".eot" => "application/vnd.ms-fontobject",
  165. ".eps" => "application/postscript",
  166. ".es3" => "application/vnd.eszigno3+xml",
  167. ".esf" => "application/vnd.epson.esf",
  168. ".etx" => "text/x-setext",
  169. ".exe" => "application/x-msdownload",
  170. ".ext" => "application/vnd.novadigm.ext",
  171. ".ez" => "application/andrew-inset",
  172. ".ez2" => "application/vnd.ezpix-album",
  173. ".ez3" => "application/vnd.ezpix-package",
  174. ".f" => "text/x-fortran",
  175. ".f77" => "text/x-fortran",
  176. ".f90" => "text/x-fortran",
  177. ".fbs" => "image/vnd.fastbidsheet",
  178. ".fdf" => "application/vnd.fdf",
  179. ".fe_launch" => "application/vnd.denovo.fcselayout-link",
  180. ".fg5" => "application/vnd.fujitsu.oasysgp",
  181. ".fli" => "video/x-fli",
  182. ".flo" => "application/vnd.micrografx.flo",
  183. ".flv" => "video/x-flv",
  184. ".flw" => "application/vnd.kde.kivio",
  185. ".flx" => "text/vnd.fmi.flexstor",
  186. ".fly" => "text/vnd.fly",
  187. ".fm" => "application/vnd.framemaker",
  188. ".fnc" => "application/vnd.frogans.fnc",
  189. ".for" => "text/x-fortran",
  190. ".fpx" => "image/vnd.fpx",
  191. ".fsc" => "application/vnd.fsc.weblaunch",
  192. ".fst" => "image/vnd.fst",
  193. ".ftc" => "application/vnd.fluxtime.clip",
  194. ".fti" => "application/vnd.anser-web-funds-transfer-initiation",
  195. ".fvt" => "video/vnd.fvt",
  196. ".fzs" => "application/vnd.fuzzysheet",
  197. ".g3" => "image/g3fax",
  198. ".gac" => "application/vnd.groove-account",
  199. ".gdl" => "model/vnd.gdl",
  200. ".gem" => "application/octet-stream",
  201. ".gemspec" => "text/x-script.ruby",
  202. ".ghf" => "application/vnd.groove-help",
  203. ".gif" => "image/gif",
  204. ".gim" => "application/vnd.groove-identity-message",
  205. ".gmx" => "application/vnd.gmx",
  206. ".gph" => "application/vnd.flographit",
  207. ".gqf" => "application/vnd.grafeq",
  208. ".gram" => "application/srgs",
  209. ".grv" => "application/vnd.groove-injector",
  210. ".grxml" => "application/srgs+xml",
  211. ".gtar" => "application/x-gtar",
  212. ".gtm" => "application/vnd.groove-tool-message",
  213. ".gtw" => "model/vnd.gtw",
  214. ".gv" => "text/vnd.graphviz",
  215. ".gz" => "application/x-gzip",
  216. ".h" => "text/x-c",
  217. ".h261" => "video/h261",
  218. ".h263" => "video/h263",
  219. ".h264" => "video/h264",
  220. ".hbci" => "application/vnd.hbci",
  221. ".hdf" => "application/x-hdf",
  222. ".hh" => "text/x-c",
  223. ".hlp" => "application/winhlp",
  224. ".hpgl" => "application/vnd.hp-hpgl",
  225. ".hpid" => "application/vnd.hp-hpid",
  226. ".hps" => "application/vnd.hp-hps",
  227. ".hqx" => "application/mac-binhex40",
  228. ".htc" => "text/x-component",
  229. ".htke" => "application/vnd.kenameaapp",
  230. ".htm" => "text/html",
  231. ".html" => "text/html",
  232. ".hvd" => "application/vnd.yamaha.hv-dic",
  233. ".hvp" => "application/vnd.yamaha.hv-voice",
  234. ".hvs" => "application/vnd.yamaha.hv-script",
  235. ".icc" => "application/vnd.iccprofile",
  236. ".ice" => "x-conference/x-cooltalk",
  237. ".ico" => "image/vnd.microsoft.icon",
  238. ".ics" => "text/calendar",
  239. ".ief" => "image/ief",
  240. ".ifb" => "text/calendar",
  241. ".ifm" => "application/vnd.shana.informed.formdata",
  242. ".igl" => "application/vnd.igloader",
  243. ".igs" => "model/iges",
  244. ".igx" => "application/vnd.micrografx.igx",
  245. ".iif" => "application/vnd.shana.informed.interchange",
  246. ".imp" => "application/vnd.accpac.simply.imp",
  247. ".ims" => "application/vnd.ms-ims",
  248. ".ipk" => "application/vnd.shana.informed.package",
  249. ".irm" => "application/vnd.ibm.rights-management",
  250. ".irp" => "application/vnd.irepository.package+xml",
  251. ".iso" => "application/octet-stream",
  252. ".itp" => "application/vnd.shana.informed.formtemplate",
  253. ".ivp" => "application/vnd.immervision-ivp",
  254. ".ivu" => "application/vnd.immervision-ivu",
  255. ".jad" => "text/vnd.sun.j2me.app-descriptor",
  256. ".jam" => "application/vnd.jam",
  257. ".jar" => "application/java-archive",
  258. ".java" => "text/x-java-source",
  259. ".jisp" => "application/vnd.jisp",
  260. ".jlt" => "application/vnd.hp-jlyt",
  261. ".jnlp" => "application/x-java-jnlp-file",
  262. ".joda" => "application/vnd.joost.joda-archive",
  263. ".jp2" => "image/jp2",
  264. ".jpeg" => "image/jpeg",
  265. ".jpg" => "image/jpeg",
  266. ".jpgv" => "video/jpeg",
  267. ".jpm" => "video/jpm",
  268. ".js" => "application/javascript",
  269. ".json" => "application/json",
  270. ".karbon" => "application/vnd.kde.karbon",
  271. ".kfo" => "application/vnd.kde.kformula",
  272. ".kia" => "application/vnd.kidspiration",
  273. ".kml" => "application/vnd.google-earth.kml+xml",
  274. ".kmz" => "application/vnd.google-earth.kmz",
  275. ".kne" => "application/vnd.kinar",
  276. ".kon" => "application/vnd.kde.kontour",
  277. ".kpr" => "application/vnd.kde.kpresenter",
  278. ".ksp" => "application/vnd.kde.kspread",
  279. ".ktz" => "application/vnd.kahootz",
  280. ".kwd" => "application/vnd.kde.kword",
  281. ".latex" => "application/x-latex",
  282. ".lbd" => "application/vnd.llamagraphics.life-balance.desktop",
  283. ".lbe" => "application/vnd.llamagraphics.life-balance.exchange+xml",
  284. ".les" => "application/vnd.hhe.lesson-player",
  285. ".link66" => "application/vnd.route66.link66+xml",
  286. ".log" => "text/plain",
  287. ".lostxml" => "application/lost+xml",
  288. ".lrm" => "application/vnd.ms-lrm",
  289. ".ltf" => "application/vnd.frogans.ltf",
  290. ".lvp" => "audio/vnd.lucent.voice",
  291. ".lwp" => "application/vnd.lotus-wordpro",
  292. ".m3u" => "audio/x-mpegurl",
  293. ".m4a" => "audio/mp4a-latm",
  294. ".m4v" => "video/mp4",
  295. ".ma" => "application/mathematica",
  296. ".mag" => "application/vnd.ecowin.chart",
  297. ".man" => "text/troff",
  298. ".manifest" => "text/cache-manifest",
  299. ".mathml" => "application/mathml+xml",
  300. ".mbk" => "application/vnd.mobius.mbk",
  301. ".mbox" => "application/mbox",
  302. ".mc1" => "application/vnd.medcalcdata",
  303. ".mcd" => "application/vnd.mcd",
  304. ".mdb" => "application/x-msaccess",
  305. ".mdi" => "image/vnd.ms-modi",
  306. ".mdoc" => "text/troff",
  307. ".me" => "text/troff",
  308. ".mfm" => "application/vnd.mfmp",
  309. ".mgz" => "application/vnd.proteus.magazine",
  310. ".mid" => "audio/midi",
  311. ".midi" => "audio/midi",
  312. ".mif" => "application/vnd.mif",
  313. ".mime" => "message/rfc822",
  314. ".mj2" => "video/mj2",
  315. ".mlp" => "application/vnd.dolby.mlp",
  316. ".mmd" => "application/vnd.chipnuts.karaoke-mmd",
  317. ".mmf" => "application/vnd.smaf",
  318. ".mml" => "application/mathml+xml",
  319. ".mmr" => "image/vnd.fujixerox.edmics-mmr",
  320. ".mng" => "video/x-mng",
  321. ".mny" => "application/x-msmoney",
  322. ".mov" => "video/quicktime",
  323. ".movie" => "video/x-sgi-movie",
  324. ".mp3" => "audio/mpeg",
  325. ".mp4" => "video/mp4",
  326. ".mp4a" => "audio/mp4",
  327. ".mp4s" => "application/mp4",
  328. ".mp4v" => "video/mp4",
  329. ".mpc" => "application/vnd.mophun.certificate",
  330. ".mpeg" => "video/mpeg",
  331. ".mpg" => "video/mpeg",
  332. ".mpga" => "audio/mpeg",
  333. ".mpkg" => "application/vnd.apple.installer+xml",
  334. ".mpm" => "application/vnd.blueice.multipass",
  335. ".mpn" => "application/vnd.mophun.application",
  336. ".mpp" => "application/vnd.ms-project",
  337. ".mpy" => "application/vnd.ibm.minipay",
  338. ".mqy" => "application/vnd.mobius.mqy",
  339. ".mrc" => "application/marc",
  340. ".ms" => "text/troff",
  341. ".mscml" => "application/mediaservercontrol+xml",
  342. ".mseq" => "application/vnd.mseq",
  343. ".msf" => "application/vnd.epson.msf",
  344. ".msh" => "model/mesh",
  345. ".msi" => "application/x-msdownload",
  346. ".msl" => "application/vnd.mobius.msl",
  347. ".msty" => "application/vnd.muvee.style",
  348. ".mts" => "model/vnd.mts",
  349. ".mus" => "application/vnd.musician",
  350. ".mvb" => "application/x-msmediaview",
  351. ".mwf" => "application/vnd.mfer",
  352. ".mxf" => "application/mxf",
  353. ".mxl" => "application/vnd.recordare.musicxml",
  354. ".mxml" => "application/xv+xml",
  355. ".mxs" => "application/vnd.triscape.mxs",
  356. ".mxu" => "video/vnd.mpegurl",
  357. ".n" => "application/vnd.nokia.n-gage.symbian.install",
  358. ".nc" => "application/x-netcdf",
  359. ".ngdat" => "application/vnd.nokia.n-gage.data",
  360. ".nlu" => "application/vnd.neurolanguage.nlu",
  361. ".nml" => "application/vnd.enliven",
  362. ".nnd" => "application/vnd.noblenet-directory",
  363. ".nns" => "application/vnd.noblenet-sealer",
  364. ".nnw" => "application/vnd.noblenet-web",
  365. ".npx" => "image/vnd.net-fpx",
  366. ".nsf" => "application/vnd.lotus-notes",
  367. ".oa2" => "application/vnd.fujitsu.oasys2",
  368. ".oa3" => "application/vnd.fujitsu.oasys3",
  369. ".oas" => "application/vnd.fujitsu.oasys",
  370. ".obd" => "application/x-msbinder",
  371. ".oda" => "application/oda",
  372. ".odc" => "application/vnd.oasis.opendocument.chart",
  373. ".odf" => "application/vnd.oasis.opendocument.formula",
  374. ".odg" => "application/vnd.oasis.opendocument.graphics",
  375. ".odi" => "application/vnd.oasis.opendocument.image",
  376. ".odp" => "application/vnd.oasis.opendocument.presentation",
  377. ".ods" => "application/vnd.oasis.opendocument.spreadsheet",
  378. ".odt" => "application/vnd.oasis.opendocument.text",
  379. ".oga" => "audio/ogg",
  380. ".ogg" => "application/ogg",
  381. ".ogv" => "video/ogg",
  382. ".ogx" => "application/ogg",
  383. ".org" => "application/vnd.lotus-organizer",
  384. ".otc" => "application/vnd.oasis.opendocument.chart-template",
  385. ".otf" => "application/vnd.oasis.opendocument.formula-template",
  386. ".otg" => "application/vnd.oasis.opendocument.graphics-template",
  387. ".oth" => "application/vnd.oasis.opendocument.text-web",
  388. ".oti" => "application/vnd.oasis.opendocument.image-template",
  389. ".otm" => "application/vnd.oasis.opendocument.text-master",
  390. ".ots" => "application/vnd.oasis.opendocument.spreadsheet-template",
  391. ".ott" => "application/vnd.oasis.opendocument.text-template",
  392. ".oxt" => "application/vnd.openofficeorg.extension",
  393. ".p" => "text/x-pascal",
  394. ".p10" => "application/pkcs10",
  395. ".p12" => "application/x-pkcs12",
  396. ".p7b" => "application/x-pkcs7-certificates",
  397. ".p7m" => "application/pkcs7-mime",
  398. ".p7r" => "application/x-pkcs7-certreqresp",
  399. ".p7s" => "application/pkcs7-signature",
  400. ".pas" => "text/x-pascal",
  401. ".pbd" => "application/vnd.powerbuilder6",
  402. ".pbm" => "image/x-portable-bitmap",
  403. ".pcl" => "application/vnd.hp-pcl",
  404. ".pclxl" => "application/vnd.hp-pclxl",
  405. ".pcx" => "image/x-pcx",
  406. ".pdb" => "chemical/x-pdb",
  407. ".pdf" => "application/pdf",
  408. ".pem" => "application/x-x509-ca-cert",
  409. ".pfr" => "application/font-tdpfr",
  410. ".pgm" => "image/x-portable-graymap",
  411. ".pgn" => "application/x-chess-pgn",
  412. ".pgp" => "application/pgp-encrypted",
  413. ".pic" => "image/x-pict",
  414. ".pict" => "image/pict",
  415. ".pkg" => "application/octet-stream",
  416. ".pki" => "application/pkixcmp",
  417. ".pkipath" => "application/pkix-pkipath",
  418. ".pl" => "text/x-script.perl",
  419. ".plb" => "application/vnd.3gpp.pic-bw-large",
  420. ".plc" => "application/vnd.mobius.plc",
  421. ".plf" => "application/vnd.pocketlearn",
  422. ".pls" => "application/pls+xml",
  423. ".pm" => "text/x-script.perl-module",
  424. ".pml" => "application/vnd.ctc-posml",
  425. ".png" => "image/png",
  426. ".pnm" => "image/x-portable-anymap",
  427. ".pntg" => "image/x-macpaint",
  428. ".portpkg" => "application/vnd.macports.portpkg",
  429. ".ppd" => "application/vnd.cups-ppd",
  430. ".ppm" => "image/x-portable-pixmap",
  431. ".pps" => "application/vnd.ms-powerpoint",
  432. ".ppt" => "application/vnd.ms-powerpoint",
  433. ".prc" => "application/vnd.palm",
  434. ".pre" => "application/vnd.lotus-freelance",
  435. ".prf" => "application/pics-rules",
  436. ".ps" => "application/postscript",
  437. ".psb" => "application/vnd.3gpp.pic-bw-small",
  438. ".psd" => "image/vnd.adobe.photoshop",
  439. ".ptid" => "application/vnd.pvi.ptid1",
  440. ".pub" => "application/x-mspublisher",
  441. ".pvb" => "application/vnd.3gpp.pic-bw-var",
  442. ".pwn" => "application/vnd.3m.post-it-notes",
  443. ".py" => "text/x-script.python",
  444. ".pya" => "audio/vnd.ms-playready.media.pya",
  445. ".pyv" => "video/vnd.ms-playready.media.pyv",
  446. ".qam" => "application/vnd.epson.quickanime",
  447. ".qbo" => "application/vnd.intu.qbo",
  448. ".qfx" => "application/vnd.intu.qfx",
  449. ".qps" => "application/vnd.publishare-delta-tree",
  450. ".qt" => "video/quicktime",
  451. ".qtif" => "image/x-quicktime",
  452. ".qxd" => "application/vnd.quark.quarkxpress",
  453. ".ra" => "audio/x-pn-realaudio",
  454. ".rake" => "text/x-script.ruby",
  455. ".ram" => "audio/x-pn-realaudio",
  456. ".rar" => "application/x-rar-compressed",
  457. ".ras" => "image/x-cmu-raster",
  458. ".rb" => "text/x-script.ruby",
  459. ".rcprofile" => "application/vnd.ipunplugged.rcprofile",
  460. ".rdf" => "application/rdf+xml",
  461. ".rdz" => "application/vnd.data-vision.rdz",
  462. ".rep" => "application/vnd.businessobjects",
  463. ".rgb" => "image/x-rgb",
  464. ".rif" => "application/reginfo+xml",
  465. ".rl" => "application/resource-lists+xml",
  466. ".rlc" => "image/vnd.fujixerox.edmics-rlc",
  467. ".rld" => "application/resource-lists-diff+xml",
  468. ".rm" => "application/vnd.rn-realmedia",
  469. ".rmp" => "audio/x-pn-realaudio-plugin",
  470. ".rms" => "application/vnd.jcp.javame.midlet-rms",
  471. ".rnc" => "application/relax-ng-compact-syntax",
  472. ".roff" => "text/troff",
  473. ".rpm" => "application/x-redhat-package-manager",
  474. ".rpss" => "application/vnd.nokia.radio-presets",
  475. ".rpst" => "application/vnd.nokia.radio-preset",
  476. ".rq" => "application/sparql-query",
  477. ".rs" => "application/rls-services+xml",
  478. ".rsd" => "application/rsd+xml",
  479. ".rss" => "application/rss+xml",
  480. ".rtf" => "application/rtf",
  481. ".rtx" => "text/richtext",
  482. ".ru" => "text/x-script.ruby",
  483. ".s" => "text/x-asm",
  484. ".saf" => "application/vnd.yamaha.smaf-audio",
  485. ".sbml" => "application/sbml+xml",
  486. ".sc" => "application/vnd.ibm.secure-container",
  487. ".scd" => "application/x-msschedule",
  488. ".scm" => "application/vnd.lotus-screencam",
  489. ".scq" => "application/scvp-cv-request",
  490. ".scs" => "application/scvp-cv-response",
  491. ".sdkm" => "application/vnd.solent.sdkm+xml",
  492. ".sdp" => "application/sdp",
  493. ".see" => "application/vnd.seemail",
  494. ".sema" => "application/vnd.sema",
  495. ".semd" => "application/vnd.semd",
  496. ".semf" => "application/vnd.semf",
  497. ".setpay" => "application/set-payment-initiation",
  498. ".setreg" => "application/set-registration-initiation",
  499. ".sfd" => "application/vnd.hydrostatix.sof-data",
  500. ".sfs" => "application/vnd.spotfire.sfs",
  501. ".sgm" => "text/sgml",
  502. ".sgml" => "text/sgml",
  503. ".sh" => "application/x-sh",
  504. ".shar" => "application/x-shar",
  505. ".shf" => "application/shf+xml",
  506. ".sig" => "application/pgp-signature",
  507. ".sit" => "application/x-stuffit",
  508. ".sitx" => "application/x-stuffitx",
  509. ".skp" => "application/vnd.koan",
  510. ".slt" => "application/vnd.epson.salt",
  511. ".smi" => "application/smil+xml",
  512. ".snd" => "audio/basic",
  513. ".so" => "application/octet-stream",
  514. ".spf" => "application/vnd.yamaha.smaf-phrase",
  515. ".spl" => "application/x-futuresplash",
  516. ".spot" => "text/vnd.in3d.spot",
  517. ".spp" => "application/scvp-vp-response",
  518. ".spq" => "application/scvp-vp-request",
  519. ".src" => "application/x-wais-source",
  520. ".srx" => "application/sparql-results+xml",
  521. ".sse" => "application/vnd.kodak-descriptor",
  522. ".ssf" => "application/vnd.epson.ssf",
  523. ".ssml" => "application/ssml+xml",
  524. ".stf" => "application/vnd.wt.stf",
  525. ".stk" => "application/hyperstudio",
  526. ".str" => "application/vnd.pg.format",
  527. ".sus" => "application/vnd.sus-calendar",
  528. ".sv4cpio" => "application/x-sv4cpio",
  529. ".sv4crc" => "application/x-sv4crc",
  530. ".svd" => "application/vnd.svd",
  531. ".svg" => "image/svg+xml",
  532. ".svgz" => "image/svg+xml",
  533. ".swf" => "application/x-shockwave-flash",
  534. ".swi" => "application/vnd.arastra.swi",
  535. ".t" => "text/troff",
  536. ".tao" => "application/vnd.tao.intent-module-archive",
  537. ".tar" => "application/x-tar",
  538. ".tbz" => "application/x-bzip-compressed-tar",
  539. ".tcap" => "application/vnd.3gpp2.tcap",
  540. ".tcl" => "application/x-tcl",
  541. ".tex" => "application/x-tex",
  542. ".texi" => "application/x-texinfo",
  543. ".texinfo" => "application/x-texinfo",
  544. ".text" => "text/plain",
  545. ".tif" => "image/tiff",
  546. ".tiff" => "image/tiff",
  547. ".tmo" => "application/vnd.tmobile-livetv",
  548. ".torrent" => "application/x-bittorrent",
  549. ".tpl" => "application/vnd.groove-tool-template",
  550. ".tpt" => "application/vnd.trid.tpt",
  551. ".tr" => "text/troff",
  552. ".tra" => "application/vnd.trueapp",
  553. ".trm" => "application/x-msterminal",
  554. ".tsv" => "text/tab-separated-values",
  555. ".ttf" => "application/octet-stream",
  556. ".twd" => "application/vnd.simtech-mindmapper",
  557. ".txd" => "application/vnd.genomatix.tuxedo",
  558. ".txf" => "application/vnd.mobius.txf",
  559. ".txt" => "text/plain",
  560. ".ufd" => "application/vnd.ufdl",
  561. ".umj" => "application/vnd.umajin",
  562. ".unityweb" => "application/vnd.unity",
  563. ".uoml" => "application/vnd.uoml+xml",
  564. ".uri" => "text/uri-list",
  565. ".ustar" => "application/x-ustar",
  566. ".utz" => "application/vnd.uiq.theme",
  567. ".uu" => "text/x-uuencode",
  568. ".vcd" => "application/x-cdlink",
  569. ".vcf" => "text/x-vcard",
  570. ".vcg" => "application/vnd.groove-vcard",
  571. ".vcs" => "text/x-vcalendar",
  572. ".vcx" => "application/vnd.vcx",
  573. ".vis" => "application/vnd.visionary",
  574. ".viv" => "video/vnd.vivo",
  575. ".vrml" => "model/vrml",
  576. ".vsd" => "application/vnd.visio",
  577. ".vsf" => "application/vnd.vsf",
  578. ".vtu" => "model/vnd.vtu",
  579. ".vxml" => "application/voicexml+xml",
  580. ".war" => "application/java-archive",
  581. ".wav" => "audio/x-wav",
  582. ".wax" => "audio/x-ms-wax",
  583. ".wbmp" => "image/vnd.wap.wbmp",
  584. ".wbs" => "application/vnd.criticaltools.wbs+xml",
  585. ".wbxml" => "application/vnd.wap.wbxml",
  586. ".webm" => "video/webm",
  587. ".wm" => "video/x-ms-wm",
  588. ".wma" => "audio/x-ms-wma",
  589. ".wmd" => "application/x-ms-wmd",
  590. ".wmf" => "application/x-msmetafile",
  591. ".wml" => "text/vnd.wap.wml",
  592. ".wmlc" => "application/vnd.wap.wmlc",
  593. ".wmls" => "text/vnd.wap.wmlscript",
  594. ".wmlsc" => "application/vnd.wap.wmlscriptc",
  595. ".wmv" => "video/x-ms-wmv",
  596. ".wmx" => "video/x-ms-wmx",
  597. ".wmz" => "application/x-ms-wmz",
  598. ".woff" => "application/octet-stream",
  599. ".wpd" => "application/vnd.wordperfect",
  600. ".wpl" => "application/vnd.ms-wpl",
  601. ".wps" => "application/vnd.ms-works",
  602. ".wqd" => "application/vnd.wqd",
  603. ".wri" => "application/x-mswrite",
  604. ".wrl" => "model/vrml",
  605. ".wsdl" => "application/wsdl+xml",
  606. ".wspolicy" => "application/wspolicy+xml",
  607. ".wtb" => "application/vnd.webturbo",
  608. ".wvx" => "video/x-ms-wvx",
  609. ".x3d" => "application/vnd.hzn-3d-crossword",
  610. ".xar" => "application/vnd.xara",
  611. ".xbd" => "application/vnd.fujixerox.docuworks.binder",
  612. ".xbm" => "image/x-xbitmap",
  613. ".xdm" => "application/vnd.syncml.dm+xml",
  614. ".xdp" => "application/vnd.adobe.xdp+xml",
  615. ".xdw" => "application/vnd.fujixerox.docuworks",
  616. ".xenc" => "application/xenc+xml",
  617. ".xer" => "application/patch-ops-error+xml",
  618. ".xfdf" => "application/vnd.adobe.xfdf",
  619. ".xfdl" => "application/vnd.xfdl",
  620. ".xhtml" => "application/xhtml+xml",
  621. ".xif" => "image/vnd.xiff",
  622. ".xls" => "application/vnd.ms-excel",
  623. ".xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  624. ".xml" => "application/xml",
  625. ".xo" => "application/vnd.olpc-sugar",
  626. ".xop" => "application/xop+xml",
  627. ".xpm" => "image/x-xpixmap",
  628. ".xpr" => "application/vnd.is-xpr",
  629. ".xps" => "application/vnd.ms-xpsdocument",
  630. ".xpw" => "application/vnd.intercon.formnet",
  631. ".xsl" => "application/xml",
  632. ".xslt" => "application/xslt+xml",
  633. ".xsm" => "application/vnd.syncml+xml",
  634. ".xspf" => "application/xspf+xml",
  635. ".xul" => "application/vnd.mozilla.xul+xml",
  636. ".xwd" => "image/x-xwindowdump",
  637. ".xyz" => "chemical/x-xyz",
  638. ".yaml" => "text/yaml",
  639. ".yml" => "text/yaml",
  640. ".zaz" => "application/vnd.zzazz.deck+xml",
  641. ".zip" => "application/zip",
  642. ".zmm" => "application/vnd.handheld-entertainment+xml",
  643. }
  644. end
  645. end