1<?php 2/** 3 * Copyright 2017 Facebook, Inc. 4 * 5 * You are hereby granted a non-exclusive, worldwide, royalty-free license to 6 * use, copy, modify, and distribute this software in source code or binary 7 * form for use in connection with the web services and APIs provided by 8 * Facebook. 9 * 10 * As with any software that integrates with the Facebook platform, your use 11 * of this software is subject to the Facebook Developer Principles and 12 * Policies [http://developers.facebook.com/policy/]. This copyright notice 13 * shall be included in all copies or substantial portions of the software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 * DEALINGS IN THE SOFTWARE. 22 * 23 */ 24namespace Facebook\FileUpload; 25 26/** 27 * Provides mappings of file extensions to mimetypes 28 * 29 * Taken from Guzzle 30 * 31 * @see https://github.com/guzzle/guzzle/blob/master/src/Mimetypes.php 32 * 33 * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types 34 */ 35class Mimetypes 36{ 37 /** @var self */ 38 protected static $instance; 39 40 /** @var array Mapping of extension to mimetype */ 41 protected $mimetypes = [ 42 '3dml' => 'text/vnd.in3d.3dml', 43 '3g2' => 'video/3gpp2', 44 '3gp' => 'video/3gpp', 45 '7z' => 'application/x-7z-compressed', 46 'aab' => 'application/x-authorware-bin', 47 'aac' => 'audio/x-aac', 48 'aam' => 'application/x-authorware-map', 49 'aas' => 'application/x-authorware-seg', 50 'abw' => 'application/x-abiword', 51 'ac' => 'application/pkix-attr-cert', 52 'acc' => 'application/vnd.americandynamics.acc', 53 'ace' => 'application/x-ace-compressed', 54 'acu' => 'application/vnd.acucobol', 55 'acutc' => 'application/vnd.acucorp', 56 'adp' => 'audio/adpcm', 57 'aep' => 'application/vnd.audiograph', 58 'afm' => 'application/x-font-type1', 59 'afp' => 'application/vnd.ibm.modcap', 60 'ahead' => 'application/vnd.ahead.space', 61 'ai' => 'application/postscript', 62 'aif' => 'audio/x-aiff', 63 'aifc' => 'audio/x-aiff', 64 'aiff' => 'audio/x-aiff', 65 'air' => 'application/vnd.adobe.air-application-installer-package+zip', 66 'ait' => 'application/vnd.dvb.ait', 67 'ami' => 'application/vnd.amiga.ami', 68 'apk' => 'application/vnd.android.package-archive', 69 'application' => 'application/x-ms-application', 70 'apr' => 'application/vnd.lotus-approach', 71 'asa' => 'text/plain', 72 'asax' => 'application/octet-stream', 73 'asc' => 'application/pgp-signature', 74 'ascx' => 'text/plain', 75 'asf' => 'video/x-ms-asf', 76 'ashx' => 'text/plain', 77 'asm' => 'text/x-asm', 78 'asmx' => 'text/plain', 79 'aso' => 'application/vnd.accpac.simply.aso', 80 'asp' => 'text/plain', 81 'aspx' => 'text/plain', 82 'asx' => 'video/x-ms-asf', 83 'atc' => 'application/vnd.acucorp', 84 'atom' => 'application/atom+xml', 85 'atomcat' => 'application/atomcat+xml', 86 'atomsvc' => 'application/atomsvc+xml', 87 'atx' => 'application/vnd.antix.game-component', 88 'au' => 'audio/basic', 89 'avi' => 'video/x-msvideo', 90 'aw' => 'application/applixware', 91 'axd' => 'text/plain', 92 'azf' => 'application/vnd.airzip.filesecure.azf', 93 'azs' => 'application/vnd.airzip.filesecure.azs', 94 'azw' => 'application/vnd.amazon.ebook', 95 'bat' => 'application/x-msdownload', 96 'bcpio' => 'application/x-bcpio', 97 'bdf' => 'application/x-font-bdf', 98 'bdm' => 'application/vnd.syncml.dm+wbxml', 99 'bed' => 'application/vnd.realvnc.bed', 100 'bh2' => 'application/vnd.fujitsu.oasysprs', 101 'bin' => 'application/octet-stream', 102 'bmi' => 'application/vnd.bmi', 103 'bmp' => 'image/bmp', 104 'book' => 'application/vnd.framemaker', 105 'box' => 'application/vnd.previewsystems.box', 106 'boz' => 'application/x-bzip2', 107 'bpk' => 'application/octet-stream', 108 'btif' => 'image/prs.btif', 109 'bz' => 'application/x-bzip', 110 'bz2' => 'application/x-bzip2', 111 'c' => 'text/x-c', 112 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', 113 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', 114 'c4d' => 'application/vnd.clonk.c4group', 115 'c4f' => 'application/vnd.clonk.c4group', 116 'c4g' => 'application/vnd.clonk.c4group', 117 'c4p' => 'application/vnd.clonk.c4group', 118 'c4u' => 'application/vnd.clonk.c4group', 119 'cab' => 'application/vnd.ms-cab-compressed', 120 'car' => 'application/vnd.curl.car', 121 'cat' => 'application/vnd.ms-pki.seccat', 122 'cc' => 'text/x-c', 123 'cct' => 'application/x-director', 124 'ccxml' => 'application/ccxml+xml', 125 'cdbcmsg' => 'application/vnd.contact.cmsg', 126 'cdf' => 'application/x-netcdf', 127 'cdkey' => 'application/vnd.mediastation.cdkey', 128 'cdmia' => 'application/cdmi-capability', 129 'cdmic' => 'application/cdmi-container', 130 'cdmid' => 'application/cdmi-domain', 131 'cdmio' => 'application/cdmi-object', 132 'cdmiq' => 'application/cdmi-queue', 133 'cdx' => 'chemical/x-cdx', 134 'cdxml' => 'application/vnd.chemdraw+xml', 135 'cdy' => 'application/vnd.cinderella', 136 'cer' => 'application/pkix-cert', 137 'cfc' => 'application/x-coldfusion', 138 'cfm' => 'application/x-coldfusion', 139 'cgm' => 'image/cgm', 140 'chat' => 'application/x-chat', 141 'chm' => 'application/vnd.ms-htmlhelp', 142 'chrt' => 'application/vnd.kde.kchart', 143 'cif' => 'chemical/x-cif', 144 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', 145 'cil' => 'application/vnd.ms-artgalry', 146 'cla' => 'application/vnd.claymore', 147 'class' => 'application/java-vm', 148 'clkk' => 'application/vnd.crick.clicker.keyboard', 149 'clkp' => 'application/vnd.crick.clicker.palette', 150 'clkt' => 'application/vnd.crick.clicker.template', 151 'clkw' => 'application/vnd.crick.clicker.wordbank', 152 'clkx' => 'application/vnd.crick.clicker', 153 'clp' => 'application/x-msclip', 154 'cmc' => 'application/vnd.cosmocaller', 155 'cmdf' => 'chemical/x-cmdf', 156 'cml' => 'chemical/x-cml', 157 'cmp' => 'application/vnd.yellowriver-custom-menu', 158 'cmx' => 'image/x-cmx', 159 'cod' => 'application/vnd.rim.cod', 160 'com' => 'application/x-msdownload', 161 'conf' => 'text/plain', 162 'cpio' => 'application/x-cpio', 163 'cpp' => 'text/x-c', 164 'cpt' => 'application/mac-compactpro', 165 'crd' => 'application/x-mscardfile', 166 'crl' => 'application/pkix-crl', 167 'crt' => 'application/x-x509-ca-cert', 168 'cryptonote' => 'application/vnd.rig.cryptonote', 169 'cs' => 'text/plain', 170 'csh' => 'application/x-csh', 171 'csml' => 'chemical/x-csml', 172 'csp' => 'application/vnd.commonspace', 173 'css' => 'text/css', 174 'cst' => 'application/x-director', 175 'csv' => 'text/csv', 176 'cu' => 'application/cu-seeme', 177 'curl' => 'text/vnd.curl', 178 'cww' => 'application/prs.cww', 179 'cxt' => 'application/x-director', 180 'cxx' => 'text/x-c', 181 'dae' => 'model/vnd.collada+xml', 182 'daf' => 'application/vnd.mobius.daf', 183 'dataless' => 'application/vnd.fdsn.seed', 184 'davmount' => 'application/davmount+xml', 185 'dcr' => 'application/x-director', 186 'dcurl' => 'text/vnd.curl.dcurl', 187 'dd2' => 'application/vnd.oma.dd2+xml', 188 'ddd' => 'application/vnd.fujixerox.ddd', 189 'deb' => 'application/x-debian-package', 190 'def' => 'text/plain', 191 'deploy' => 'application/octet-stream', 192 'der' => 'application/x-x509-ca-cert', 193 'dfac' => 'application/vnd.dreamfactory', 194 'dic' => 'text/x-c', 195 'dir' => 'application/x-director', 196 'dis' => 'application/vnd.mobius.dis', 197 'dist' => 'application/octet-stream', 198 'distz' => 'application/octet-stream', 199 'djv' => 'image/vnd.djvu', 200 'djvu' => 'image/vnd.djvu', 201 'dll' => 'application/x-msdownload', 202 'dmg' => 'application/octet-stream', 203 'dms' => 'application/octet-stream', 204 'dna' => 'application/vnd.dna', 205 'doc' => 'application/msword', 206 'docm' => 'application/vnd.ms-word.document.macroenabled.12', 207 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 208 'dot' => 'application/msword', 209 'dotm' => 'application/vnd.ms-word.template.macroenabled.12', 210 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 211 'dp' => 'application/vnd.osgi.dp', 212 'dpg' => 'application/vnd.dpgraph', 213 'dra' => 'audio/vnd.dra', 214 'dsc' => 'text/prs.lines.tag', 215 'dssc' => 'application/dssc+der', 216 'dtb' => 'application/x-dtbook+xml', 217 'dtd' => 'application/xml-dtd', 218 'dts' => 'audio/vnd.dts', 219 'dtshd' => 'audio/vnd.dts.hd', 220 'dump' => 'application/octet-stream', 221 'dvi' => 'application/x-dvi', 222 'dwf' => 'model/vnd.dwf', 223 'dwg' => 'image/vnd.dwg', 224 'dxf' => 'image/vnd.dxf', 225 'dxp' => 'application/vnd.spotfire.dxp', 226 'dxr' => 'application/x-director', 227 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', 228 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', 229 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', 230 'ecma' => 'application/ecmascript', 231 'edm' => 'application/vnd.novadigm.edm', 232 'edx' => 'application/vnd.novadigm.edx', 233 'efif' => 'application/vnd.picsel', 234 'ei6' => 'application/vnd.pg.osasli', 235 'elc' => 'application/octet-stream', 236 'eml' => 'message/rfc822', 237 'emma' => 'application/emma+xml', 238 'eol' => 'audio/vnd.digital-winds', 239 'eot' => 'application/vnd.ms-fontobject', 240 'eps' => 'application/postscript', 241 'epub' => 'application/epub+zip', 242 'es3' => 'application/vnd.eszigno3+xml', 243 'esf' => 'application/vnd.epson.esf', 244 'et3' => 'application/vnd.eszigno3+xml', 245 'etx' => 'text/x-setext', 246 'exe' => 'application/x-msdownload', 247 'exi' => 'application/exi', 248 'ext' => 'application/vnd.novadigm.ext', 249 'ez' => 'application/andrew-inset', 250 'ez2' => 'application/vnd.ezpix-album', 251 'ez3' => 'application/vnd.ezpix-package', 252 'f' => 'text/x-fortran', 253 'f4v' => 'video/x-f4v', 254 'f77' => 'text/x-fortran', 255 'f90' => 'text/x-fortran', 256 'fbs' => 'image/vnd.fastbidsheet', 257 'fcs' => 'application/vnd.isac.fcs', 258 'fdf' => 'application/vnd.fdf', 259 'fe_launch' => 'application/vnd.denovo.fcselayout-link', 260 'fg5' => 'application/vnd.fujitsu.oasysgp', 261 'fgd' => 'application/x-director', 262 'fh' => 'image/x-freehand', 263 'fh4' => 'image/x-freehand', 264 'fh5' => 'image/x-freehand', 265 'fh7' => 'image/x-freehand', 266 'fhc' => 'image/x-freehand', 267 'fig' => 'application/x-xfig', 268 'fli' => 'video/x-fli', 269 'flo' => 'application/vnd.micrografx.flo', 270 'flv' => 'video/x-flv', 271 'flw' => 'application/vnd.kde.kivio', 272 'flx' => 'text/vnd.fmi.flexstor', 273 'fly' => 'text/vnd.fly', 274 'fm' => 'application/vnd.framemaker', 275 'fnc' => 'application/vnd.frogans.fnc', 276 'for' => 'text/x-fortran', 277 'fpx' => 'image/vnd.fpx', 278 'frame' => 'application/vnd.framemaker', 279 'fsc' => 'application/vnd.fsc.weblaunch', 280 'fst' => 'image/vnd.fst', 281 'ftc' => 'application/vnd.fluxtime.clip', 282 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', 283 'fvt' => 'video/vnd.fvt', 284 'fxp' => 'application/vnd.adobe.fxp', 285 'fxpl' => 'application/vnd.adobe.fxp', 286 'fzs' => 'application/vnd.fuzzysheet', 287 'g2w' => 'application/vnd.geoplan', 288 'g3' => 'image/g3fax', 289 'g3w' => 'application/vnd.geospace', 290 'gac' => 'application/vnd.groove-account', 291 'gdl' => 'model/vnd.gdl', 292 'geo' => 'application/vnd.dynageo', 293 'gex' => 'application/vnd.geometry-explorer', 294 'ggb' => 'application/vnd.geogebra.file', 295 'ggt' => 'application/vnd.geogebra.tool', 296 'ghf' => 'application/vnd.groove-help', 297 'gif' => 'image/gif', 298 'gim' => 'application/vnd.groove-identity-message', 299 'gmx' => 'application/vnd.gmx', 300 'gnumeric' => 'application/x-gnumeric', 301 'gph' => 'application/vnd.flographit', 302 'gqf' => 'application/vnd.grafeq', 303 'gqs' => 'application/vnd.grafeq', 304 'gram' => 'application/srgs', 305 'gre' => 'application/vnd.geometry-explorer', 306 'grv' => 'application/vnd.groove-injector', 307 'grxml' => 'application/srgs+xml', 308 'gsf' => 'application/x-font-ghostscript', 309 'gtar' => 'application/x-gtar', 310 'gtm' => 'application/vnd.groove-tool-message', 311 'gtw' => 'model/vnd.gtw', 312 'gv' => 'text/vnd.graphviz', 313 'gxt' => 'application/vnd.geonext', 314 'h' => 'text/x-c', 315 'h261' => 'video/h261', 316 'h263' => 'video/h263', 317 'h264' => 'video/h264', 318 'hal' => 'application/vnd.hal+xml', 319 'hbci' => 'application/vnd.hbci', 320 'hdf' => 'application/x-hdf', 321 'hh' => 'text/x-c', 322 'hlp' => 'application/winhlp', 323 'hpgl' => 'application/vnd.hp-hpgl', 324 'hpid' => 'application/vnd.hp-hpid', 325 'hps' => 'application/vnd.hp-hps', 326 'hqx' => 'application/mac-binhex40', 327 'hta' => 'application/octet-stream', 328 'htc' => 'text/html', 329 'htke' => 'application/vnd.kenameaapp', 330 'htm' => 'text/html', 331 'html' => 'text/html', 332 'hvd' => 'application/vnd.yamaha.hv-dic', 333 'hvp' => 'application/vnd.yamaha.hv-voice', 334 'hvs' => 'application/vnd.yamaha.hv-script', 335 'i2g' => 'application/vnd.intergeo', 336 'icc' => 'application/vnd.iccprofile', 337 'ice' => 'x-conference/x-cooltalk', 338 'icm' => 'application/vnd.iccprofile', 339 'ico' => 'image/x-icon', 340 'ics' => 'text/calendar', 341 'ief' => 'image/ief', 342 'ifb' => 'text/calendar', 343 'ifm' => 'application/vnd.shana.informed.formdata', 344 'iges' => 'model/iges', 345 'igl' => 'application/vnd.igloader', 346 'igm' => 'application/vnd.insors.igm', 347 'igs' => 'model/iges', 348 'igx' => 'application/vnd.micrografx.igx', 349 'iif' => 'application/vnd.shana.informed.interchange', 350 'imp' => 'application/vnd.accpac.simply.imp', 351 'ims' => 'application/vnd.ms-ims', 352 'in' => 'text/plain', 353 'ini' => 'text/plain', 354 'ipfix' => 'application/ipfix', 355 'ipk' => 'application/vnd.shana.informed.package', 356 'irm' => 'application/vnd.ibm.rights-management', 357 'irp' => 'application/vnd.irepository.package+xml', 358 'iso' => 'application/octet-stream', 359 'itp' => 'application/vnd.shana.informed.formtemplate', 360 'ivp' => 'application/vnd.immervision-ivp', 361 'ivu' => 'application/vnd.immervision-ivu', 362 'jad' => 'text/vnd.sun.j2me.app-descriptor', 363 'jam' => 'application/vnd.jam', 364 'jar' => 'application/java-archive', 365 'java' => 'text/x-java-source', 366 'jisp' => 'application/vnd.jisp', 367 'jlt' => 'application/vnd.hp-jlyt', 368 'jnlp' => 'application/x-java-jnlp-file', 369 'joda' => 'application/vnd.joost.joda-archive', 370 'jpe' => 'image/jpeg', 371 'jpeg' => 'image/jpeg', 372 'jpg' => 'image/jpeg', 373 'jpgm' => 'video/jpm', 374 'jpgv' => 'video/jpeg', 375 'jpm' => 'video/jpm', 376 'js' => 'text/javascript', 377 'json' => 'application/json', 378 'kar' => 'audio/midi', 379 'karbon' => 'application/vnd.kde.karbon', 380 'kfo' => 'application/vnd.kde.kformula', 381 'kia' => 'application/vnd.kidspiration', 382 'kml' => 'application/vnd.google-earth.kml+xml', 383 'kmz' => 'application/vnd.google-earth.kmz', 384 'kne' => 'application/vnd.kinar', 385 'knp' => 'application/vnd.kinar', 386 'kon' => 'application/vnd.kde.kontour', 387 'kpr' => 'application/vnd.kde.kpresenter', 388 'kpt' => 'application/vnd.kde.kpresenter', 389 'ksp' => 'application/vnd.kde.kspread', 390 'ktr' => 'application/vnd.kahootz', 391 'ktx' => 'image/ktx', 392 'ktz' => 'application/vnd.kahootz', 393 'kwd' => 'application/vnd.kde.kword', 394 'kwt' => 'application/vnd.kde.kword', 395 'lasxml' => 'application/vnd.las.las+xml', 396 'latex' => 'application/x-latex', 397 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', 398 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', 399 'les' => 'application/vnd.hhe.lesson-player', 400 'lha' => 'application/octet-stream', 401 'link66' => 'application/vnd.route66.link66+xml', 402 'list' => 'text/plain', 403 'list3820' => 'application/vnd.ibm.modcap', 404 'listafp' => 'application/vnd.ibm.modcap', 405 'log' => 'text/plain', 406 'lostxml' => 'application/lost+xml', 407 'lrf' => 'application/octet-stream', 408 'lrm' => 'application/vnd.ms-lrm', 409 'ltf' => 'application/vnd.frogans.ltf', 410 'lvp' => 'audio/vnd.lucent.voice', 411 'lwp' => 'application/vnd.lotus-wordpro', 412 'lzh' => 'application/octet-stream', 413 'm13' => 'application/x-msmediaview', 414 'm14' => 'application/x-msmediaview', 415 'm1v' => 'video/mpeg', 416 'm21' => 'application/mp21', 417 'm2a' => 'audio/mpeg', 418 'm2v' => 'video/mpeg', 419 'm3a' => 'audio/mpeg', 420 'm3u' => 'audio/x-mpegurl', 421 'm3u8' => 'application/vnd.apple.mpegurl', 422 'm4a' => 'audio/mp4', 423 'm4u' => 'video/vnd.mpegurl', 424 'm4v' => 'video/mp4', 425 'ma' => 'application/mathematica', 426 'mads' => 'application/mads+xml', 427 'mag' => 'application/vnd.ecowin.chart', 428 'maker' => 'application/vnd.framemaker', 429 'man' => 'text/troff', 430 'mathml' => 'application/mathml+xml', 431 'mb' => 'application/mathematica', 432 'mbk' => 'application/vnd.mobius.mbk', 433 'mbox' => 'application/mbox', 434 'mc1' => 'application/vnd.medcalcdata', 435 'mcd' => 'application/vnd.mcd', 436 'mcurl' => 'text/vnd.curl.mcurl', 437 'mdb' => 'application/x-msaccess', 438 'mdi' => 'image/vnd.ms-modi', 439 'me' => 'text/troff', 440 'mesh' => 'model/mesh', 441 'meta4' => 'application/metalink4+xml', 442 'mets' => 'application/mets+xml', 443 'mfm' => 'application/vnd.mfmp', 444 'mgp' => 'application/vnd.osgeo.mapguide.package', 445 'mgz' => 'application/vnd.proteus.magazine', 446 'mid' => 'audio/midi', 447 'midi' => 'audio/midi', 448 'mif' => 'application/vnd.mif', 449 'mime' => 'message/rfc822', 450 'mj2' => 'video/mj2', 451 'mjp2' => 'video/mj2', 452 'mlp' => 'application/vnd.dolby.mlp', 453 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', 454 'mmf' => 'application/vnd.smaf', 455 'mmr' => 'image/vnd.fujixerox.edmics-mmr', 456 'mny' => 'application/x-msmoney', 457 'mobi' => 'application/x-mobipocket-ebook', 458 'mods' => 'application/mods+xml', 459 'mov' => 'video/quicktime', 460 'movie' => 'video/x-sgi-movie', 461 'mp2' => 'audio/mpeg', 462 'mp21' => 'application/mp21', 463 'mp2a' => 'audio/mpeg', 464 'mp3' => 'audio/mpeg', 465 'mp4' => 'video/mp4', 466 'mp4a' => 'audio/mp4', 467 'mp4s' => 'application/mp4', 468 'mp4v' => 'video/mp4', 469 'mpc' => 'application/vnd.mophun.certificate', 470 'mpe' => 'video/mpeg', 471 'mpeg' => 'video/mpeg', 472 'mpg' => 'video/mpeg', 473 'mpg4' => 'video/mp4', 474 'mpga' => 'audio/mpeg', 475 'mpkg' => 'application/vnd.apple.installer+xml', 476 'mpm' => 'application/vnd.blueice.multipass', 477 'mpn' => 'application/vnd.mophun.application', 478 'mpp' => 'application/vnd.ms-project', 479 'mpt' => 'application/vnd.ms-project', 480 'mpy' => 'application/vnd.ibm.minipay', 481 'mqy' => 'application/vnd.mobius.mqy', 482 'mrc' => 'application/marc', 483 'mrcx' => 'application/marcxml+xml', 484 'ms' => 'text/troff', 485 'mscml' => 'application/mediaservercontrol+xml', 486 'mseed' => 'application/vnd.fdsn.mseed', 487 'mseq' => 'application/vnd.mseq', 488 'msf' => 'application/vnd.epson.msf', 489 'msh' => 'model/mesh', 490 'msi' => 'application/x-msdownload', 491 'msl' => 'application/vnd.mobius.msl', 492 'msty' => 'application/vnd.muvee.style', 493 'mts' => 'model/vnd.mts', 494 'mus' => 'application/vnd.musician', 495 'musicxml' => 'application/vnd.recordare.musicxml+xml', 496 'mvb' => 'application/x-msmediaview', 497 'mwf' => 'application/vnd.mfer', 498 'mxf' => 'application/mxf', 499 'mxl' => 'application/vnd.recordare.musicxml', 500 'mxml' => 'application/xv+xml', 501 'mxs' => 'application/vnd.triscape.mxs', 502 'mxu' => 'video/vnd.mpegurl', 503 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', 504 'n3' => 'text/n3', 505 'nb' => 'application/mathematica', 506 'nbp' => 'application/vnd.wolfram.player', 507 'nc' => 'application/x-netcdf', 508 'ncx' => 'application/x-dtbncx+xml', 509 'ngdat' => 'application/vnd.nokia.n-gage.data', 510 'nlu' => 'application/vnd.neurolanguage.nlu', 511 'nml' => 'application/vnd.enliven', 512 'nnd' => 'application/vnd.noblenet-directory', 513 'nns' => 'application/vnd.noblenet-sealer', 514 'nnw' => 'application/vnd.noblenet-web', 515 'npx' => 'image/vnd.net-fpx', 516 'nsf' => 'application/vnd.lotus-notes', 517 'oa2' => 'application/vnd.fujitsu.oasys2', 518 'oa3' => 'application/vnd.fujitsu.oasys3', 519 'oas' => 'application/vnd.fujitsu.oasys', 520 'obd' => 'application/x-msbinder', 521 'oda' => 'application/oda', 522 'odb' => 'application/vnd.oasis.opendocument.database', 523 'odc' => 'application/vnd.oasis.opendocument.chart', 524 'odf' => 'application/vnd.oasis.opendocument.formula', 525 'odft' => 'application/vnd.oasis.opendocument.formula-template', 526 'odg' => 'application/vnd.oasis.opendocument.graphics', 527 'odi' => 'application/vnd.oasis.opendocument.image', 528 'odm' => 'application/vnd.oasis.opendocument.text-master', 529 'odp' => 'application/vnd.oasis.opendocument.presentation', 530 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 531 'odt' => 'application/vnd.oasis.opendocument.text', 532 'oga' => 'audio/ogg', 533 'ogg' => 'audio/ogg', 534 'ogv' => 'video/ogg', 535 'ogx' => 'application/ogg', 536 'onepkg' => 'application/onenote', 537 'onetmp' => 'application/onenote', 538 'onetoc' => 'application/onenote', 539 'onetoc2' => 'application/onenote', 540 'opf' => 'application/oebps-package+xml', 541 'oprc' => 'application/vnd.palm', 542 'org' => 'application/vnd.lotus-organizer', 543 'osf' => 'application/vnd.yamaha.openscoreformat', 544 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', 545 'otc' => 'application/vnd.oasis.opendocument.chart-template', 546 'otf' => 'application/x-font-otf', 547 'otg' => 'application/vnd.oasis.opendocument.graphics-template', 548 'oth' => 'application/vnd.oasis.opendocument.text-web', 549 'oti' => 'application/vnd.oasis.opendocument.image-template', 550 'otp' => 'application/vnd.oasis.opendocument.presentation-template', 551 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', 552 'ott' => 'application/vnd.oasis.opendocument.text-template', 553 'oxt' => 'application/vnd.openofficeorg.extension', 554 'p' => 'text/x-pascal', 555 'p10' => 'application/pkcs10', 556 'p12' => 'application/x-pkcs12', 557 'p7b' => 'application/x-pkcs7-certificates', 558 'p7c' => 'application/pkcs7-mime', 559 'p7m' => 'application/pkcs7-mime', 560 'p7r' => 'application/x-pkcs7-certreqresp', 561 'p7s' => 'application/pkcs7-signature', 562 'p8' => 'application/pkcs8', 563 'pas' => 'text/x-pascal', 564 'paw' => 'application/vnd.pawaafile', 565 'pbd' => 'application/vnd.powerbuilder6', 566 'pbm' => 'image/x-portable-bitmap', 567 'pcf' => 'application/x-font-pcf', 568 'pcl' => 'application/vnd.hp-pcl', 569 'pclxl' => 'application/vnd.hp-pclxl', 570 'pct' => 'image/x-pict', 571 'pcurl' => 'application/vnd.curl.pcurl', 572 'pcx' => 'image/x-pcx', 573 'pdb' => 'application/vnd.palm', 574 'pdf' => 'application/pdf', 575 'pfa' => 'application/x-font-type1', 576 'pfb' => 'application/x-font-type1', 577 'pfm' => 'application/x-font-type1', 578 'pfr' => 'application/font-tdpfr', 579 'pfx' => 'application/x-pkcs12', 580 'pgm' => 'image/x-portable-graymap', 581 'pgn' => 'application/x-chess-pgn', 582 'pgp' => 'application/pgp-encrypted', 583 'php' => 'text/x-php', 584 'phps' => 'application/x-httpd-phps', 585 'pic' => 'image/x-pict', 586 'pkg' => 'application/octet-stream', 587 'pki' => 'application/pkixcmp', 588 'pkipath' => 'application/pkix-pkipath', 589 'plb' => 'application/vnd.3gpp.pic-bw-large', 590 'plc' => 'application/vnd.mobius.plc', 591 'plf' => 'application/vnd.pocketlearn', 592 'pls' => 'application/pls+xml', 593 'pml' => 'application/vnd.ctc-posml', 594 'png' => 'image/png', 595 'pnm' => 'image/x-portable-anymap', 596 'portpkg' => 'application/vnd.macports.portpkg', 597 'pot' => 'application/vnd.ms-powerpoint', 598 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12', 599 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', 600 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12', 601 'ppd' => 'application/vnd.cups-ppd', 602 'ppm' => 'image/x-portable-pixmap', 603 'pps' => 'application/vnd.ms-powerpoint', 604 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', 605 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 606 'ppt' => 'application/vnd.ms-powerpoint', 607 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12', 608 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 609 'pqa' => 'application/vnd.palm', 610 'prc' => 'application/x-mobipocket-ebook', 611 'pre' => 'application/vnd.lotus-freelance', 612 'prf' => 'application/pics-rules', 613 'ps' => 'application/postscript', 614 'psb' => 'application/vnd.3gpp.pic-bw-small', 615 'psd' => 'image/vnd.adobe.photoshop', 616 'psf' => 'application/x-font-linux-psf', 617 'pskcxml' => 'application/pskc+xml', 618 'ptid' => 'application/vnd.pvi.ptid1', 619 'pub' => 'application/x-mspublisher', 620 'pvb' => 'application/vnd.3gpp.pic-bw-var', 621 'pwn' => 'application/vnd.3m.post-it-notes', 622 'pya' => 'audio/vnd.ms-playready.media.pya', 623 'pyv' => 'video/vnd.ms-playready.media.pyv', 624 'qam' => 'application/vnd.epson.quickanime', 625 'qbo' => 'application/vnd.intu.qbo', 626 'qfx' => 'application/vnd.intu.qfx', 627 'qps' => 'application/vnd.publishare-delta-tree', 628 'qt' => 'video/quicktime', 629 'qwd' => 'application/vnd.quark.quarkxpress', 630 'qwt' => 'application/vnd.quark.quarkxpress', 631 'qxb' => 'application/vnd.quark.quarkxpress', 632 'qxd' => 'application/vnd.quark.quarkxpress', 633 'qxl' => 'application/vnd.quark.quarkxpress', 634 'qxt' => 'application/vnd.quark.quarkxpress', 635 'ra' => 'audio/x-pn-realaudio', 636 'ram' => 'audio/x-pn-realaudio', 637 'rar' => 'application/x-rar-compressed', 638 'ras' => 'image/x-cmu-raster', 639 'rb' => 'text/plain', 640 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', 641 'rdf' => 'application/rdf+xml', 642 'rdz' => 'application/vnd.data-vision.rdz', 643 'rep' => 'application/vnd.businessobjects', 644 'res' => 'application/x-dtbresource+xml', 645 'resx' => 'text/xml', 646 'rgb' => 'image/x-rgb', 647 'rif' => 'application/reginfo+xml', 648 'rip' => 'audio/vnd.rip', 649 'rl' => 'application/resource-lists+xml', 650 'rlc' => 'image/vnd.fujixerox.edmics-rlc', 651 'rld' => 'application/resource-lists-diff+xml', 652 'rm' => 'application/vnd.rn-realmedia', 653 'rmi' => 'audio/midi', 654 'rmp' => 'audio/x-pn-realaudio-plugin', 655 'rms' => 'application/vnd.jcp.javame.midlet-rms', 656 'rnc' => 'application/relax-ng-compact-syntax', 657 'roff' => 'text/troff', 658 'rp9' => 'application/vnd.cloanto.rp9', 659 'rpss' => 'application/vnd.nokia.radio-presets', 660 'rpst' => 'application/vnd.nokia.radio-preset', 661 'rq' => 'application/sparql-query', 662 'rs' => 'application/rls-services+xml', 663 'rsd' => 'application/rsd+xml', 664 'rss' => 'application/rss+xml', 665 'rtf' => 'application/rtf', 666 'rtx' => 'text/richtext', 667 's' => 'text/x-asm', 668 'saf' => 'application/vnd.yamaha.smaf-audio', 669 'sbml' => 'application/sbml+xml', 670 'sc' => 'application/vnd.ibm.secure-container', 671 'scd' => 'application/x-msschedule', 672 'scm' => 'application/vnd.lotus-screencam', 673 'scq' => 'application/scvp-cv-request', 674 'scs' => 'application/scvp-cv-response', 675 'scurl' => 'text/vnd.curl.scurl', 676 'sda' => 'application/vnd.stardivision.draw', 677 'sdc' => 'application/vnd.stardivision.calc', 678 'sdd' => 'application/vnd.stardivision.impress', 679 'sdkd' => 'application/vnd.solent.sdkm+xml', 680 'sdkm' => 'application/vnd.solent.sdkm+xml', 681 'sdp' => 'application/sdp', 682 'sdw' => 'application/vnd.stardivision.writer', 683 'see' => 'application/vnd.seemail', 684 'seed' => 'application/vnd.fdsn.seed', 685 'sema' => 'application/vnd.sema', 686 'semd' => 'application/vnd.semd', 687 'semf' => 'application/vnd.semf', 688 'ser' => 'application/java-serialized-object', 689 'setpay' => 'application/set-payment-initiation', 690 'setreg' => 'application/set-registration-initiation', 691 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', 692 'sfs' => 'application/vnd.spotfire.sfs', 693 'sgl' => 'application/vnd.stardivision.writer-global', 694 'sgm' => 'text/sgml', 695 'sgml' => 'text/sgml', 696 'sh' => 'application/x-sh', 697 'shar' => 'application/x-shar', 698 'shf' => 'application/shf+xml', 699 'sig' => 'application/pgp-signature', 700 'silo' => 'model/mesh', 701 'sis' => 'application/vnd.symbian.install', 702 'sisx' => 'application/vnd.symbian.install', 703 'sit' => 'application/x-stuffit', 704 'sitx' => 'application/x-stuffitx', 705 'skd' => 'application/vnd.koan', 706 'skm' => 'application/vnd.koan', 707 'skp' => 'application/vnd.koan', 708 'skt' => 'application/vnd.koan', 709 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', 710 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', 711 'slt' => 'application/vnd.epson.salt', 712 'sm' => 'application/vnd.stepmania.stepchart', 713 'smf' => 'application/vnd.stardivision.math', 714 'smi' => 'application/smil+xml', 715 'smil' => 'application/smil+xml', 716 'snd' => 'audio/basic', 717 'snf' => 'application/x-font-snf', 718 'so' => 'application/octet-stream', 719 'spc' => 'application/x-pkcs7-certificates', 720 'spf' => 'application/vnd.yamaha.smaf-phrase', 721 'spl' => 'application/x-futuresplash', 722 'spot' => 'text/vnd.in3d.spot', 723 'spp' => 'application/scvp-vp-response', 724 'spq' => 'application/scvp-vp-request', 725 'spx' => 'audio/ogg', 726 'src' => 'application/x-wais-source', 727 'srt' => 'application/octet-stream', 728 'sru' => 'application/sru+xml', 729 'srx' => 'application/sparql-results+xml', 730 'sse' => 'application/vnd.kodak-descriptor', 731 'ssf' => 'application/vnd.epson.ssf', 732 'ssml' => 'application/ssml+xml', 733 'st' => 'application/vnd.sailingtracker.track', 734 'stc' => 'application/vnd.sun.xml.calc.template', 735 'std' => 'application/vnd.sun.xml.draw.template', 736 'stf' => 'application/vnd.wt.stf', 737 'sti' => 'application/vnd.sun.xml.impress.template', 738 'stk' => 'application/hyperstudio', 739 'stl' => 'application/vnd.ms-pki.stl', 740 'str' => 'application/vnd.pg.format', 741 'stw' => 'application/vnd.sun.xml.writer.template', 742 'sub' => 'image/vnd.dvb.subtitle', 743 'sus' => 'application/vnd.sus-calendar', 744 'susp' => 'application/vnd.sus-calendar', 745 'sv4cpio' => 'application/x-sv4cpio', 746 'sv4crc' => 'application/x-sv4crc', 747 'svc' => 'application/vnd.dvb.service', 748 'svd' => 'application/vnd.svd', 749 'svg' => 'image/svg+xml', 750 'svgz' => 'image/svg+xml', 751 'swa' => 'application/x-director', 752 'swf' => 'application/x-shockwave-flash', 753 'swi' => 'application/vnd.aristanetworks.swi', 754 'sxc' => 'application/vnd.sun.xml.calc', 755 'sxd' => 'application/vnd.sun.xml.draw', 756 'sxg' => 'application/vnd.sun.xml.writer.global', 757 'sxi' => 'application/vnd.sun.xml.impress', 758 'sxm' => 'application/vnd.sun.xml.math', 759 'sxw' => 'application/vnd.sun.xml.writer', 760 't' => 'text/troff', 761 'tao' => 'application/vnd.tao.intent-module-archive', 762 'tar' => 'application/x-tar', 763 'tcap' => 'application/vnd.3gpp2.tcap', 764 'tcl' => 'application/x-tcl', 765 'teacher' => 'application/vnd.smart.teacher', 766 'tei' => 'application/tei+xml', 767 'teicorpus' => 'application/tei+xml', 768 'tex' => 'application/x-tex', 769 'texi' => 'application/x-texinfo', 770 'texinfo' => 'application/x-texinfo', 771 'text' => 'text/plain', 772 'tfi' => 'application/thraud+xml', 773 'tfm' => 'application/x-tex-tfm', 774 'thmx' => 'application/vnd.ms-officetheme', 775 'tif' => 'image/tiff', 776 'tiff' => 'image/tiff', 777 'tmo' => 'application/vnd.tmobile-livetv', 778 'torrent' => 'application/x-bittorrent', 779 'tpl' => 'application/vnd.groove-tool-template', 780 'tpt' => 'application/vnd.trid.tpt', 781 'tr' => 'text/troff', 782 'tra' => 'application/vnd.trueapp', 783 'trm' => 'application/x-msterminal', 784 'tsd' => 'application/timestamped-data', 785 'tsv' => 'text/tab-separated-values', 786 'ttc' => 'application/x-font-ttf', 787 'ttf' => 'application/x-font-ttf', 788 'ttl' => 'text/turtle', 789 'twd' => 'application/vnd.simtech-mindmapper', 790 'twds' => 'application/vnd.simtech-mindmapper', 791 'txd' => 'application/vnd.genomatix.tuxedo', 792 'txf' => 'application/vnd.mobius.txf', 793 'txt' => 'text/plain', 794 'u32' => 'application/x-authorware-bin', 795 'udeb' => 'application/x-debian-package', 796 'ufd' => 'application/vnd.ufdl', 797 'ufdl' => 'application/vnd.ufdl', 798 'umj' => 'application/vnd.umajin', 799 'unityweb' => 'application/vnd.unity', 800 'uoml' => 'application/vnd.uoml+xml', 801 'uri' => 'text/uri-list', 802 'uris' => 'text/uri-list', 803 'urls' => 'text/uri-list', 804 'ustar' => 'application/x-ustar', 805 'utz' => 'application/vnd.uiq.theme', 806 'uu' => 'text/x-uuencode', 807 'uva' => 'audio/vnd.dece.audio', 808 'uvd' => 'application/vnd.dece.data', 809 'uvf' => 'application/vnd.dece.data', 810 'uvg' => 'image/vnd.dece.graphic', 811 'uvh' => 'video/vnd.dece.hd', 812 'uvi' => 'image/vnd.dece.graphic', 813 'uvm' => 'video/vnd.dece.mobile', 814 'uvp' => 'video/vnd.dece.pd', 815 'uvs' => 'video/vnd.dece.sd', 816 'uvt' => 'application/vnd.dece.ttml+xml', 817 'uvu' => 'video/vnd.uvvu.mp4', 818 'uvv' => 'video/vnd.dece.video', 819 'uvva' => 'audio/vnd.dece.audio', 820 'uvvd' => 'application/vnd.dece.data', 821 'uvvf' => 'application/vnd.dece.data', 822 'uvvg' => 'image/vnd.dece.graphic', 823 'uvvh' => 'video/vnd.dece.hd', 824 'uvvi' => 'image/vnd.dece.graphic', 825 'uvvm' => 'video/vnd.dece.mobile', 826 'uvvp' => 'video/vnd.dece.pd', 827 'uvvs' => 'video/vnd.dece.sd', 828 'uvvt' => 'application/vnd.dece.ttml+xml', 829 'uvvu' => 'video/vnd.uvvu.mp4', 830 'uvvv' => 'video/vnd.dece.video', 831 'uvvx' => 'application/vnd.dece.unspecified', 832 'uvx' => 'application/vnd.dece.unspecified', 833 'vcd' => 'application/x-cdlink', 834 'vcf' => 'text/x-vcard', 835 'vcg' => 'application/vnd.groove-vcard', 836 'vcs' => 'text/x-vcalendar', 837 'vcx' => 'application/vnd.vcx', 838 'vis' => 'application/vnd.visionary', 839 'viv' => 'video/vnd.vivo', 840 'vor' => 'application/vnd.stardivision.writer', 841 'vox' => 'application/x-authorware-bin', 842 'vrml' => 'model/vrml', 843 'vsd' => 'application/vnd.visio', 844 'vsf' => 'application/vnd.vsf', 845 'vss' => 'application/vnd.visio', 846 'vst' => 'application/vnd.visio', 847 'vsw' => 'application/vnd.visio', 848 'vtu' => 'model/vnd.vtu', 849 'vxml' => 'application/voicexml+xml', 850 'w3d' => 'application/x-director', 851 'wad' => 'application/x-doom', 852 'wav' => 'audio/x-wav', 853 'wax' => 'audio/x-ms-wax', 854 'wbmp' => 'image/vnd.wap.wbmp', 855 'wbs' => 'application/vnd.criticaltools.wbs+xml', 856 'wbxml' => 'application/vnd.wap.wbxml', 857 'wcm' => 'application/vnd.ms-works', 858 'wdb' => 'application/vnd.ms-works', 859 'weba' => 'audio/webm', 860 'webm' => 'video/webm', 861 'webp' => 'image/webp', 862 'wg' => 'application/vnd.pmi.widget', 863 'wgt' => 'application/widget', 864 'wks' => 'application/vnd.ms-works', 865 'wm' => 'video/x-ms-wm', 866 'wma' => 'audio/x-ms-wma', 867 'wmd' => 'application/x-ms-wmd', 868 'wmf' => 'application/x-msmetafile', 869 'wml' => 'text/vnd.wap.wml', 870 'wmlc' => 'application/vnd.wap.wmlc', 871 'wmls' => 'text/vnd.wap.wmlscript', 872 'wmlsc' => 'application/vnd.wap.wmlscriptc', 873 'wmv' => 'video/x-ms-wmv', 874 'wmx' => 'video/x-ms-wmx', 875 'wmz' => 'application/x-ms-wmz', 876 'woff' => 'application/x-font-woff', 877 'wpd' => 'application/vnd.wordperfect', 878 'wpl' => 'application/vnd.ms-wpl', 879 'wps' => 'application/vnd.ms-works', 880 'wqd' => 'application/vnd.wqd', 881 'wri' => 'application/x-mswrite', 882 'wrl' => 'model/vrml', 883 'wsdl' => 'application/wsdl+xml', 884 'wspolicy' => 'application/wspolicy+xml', 885 'wtb' => 'application/vnd.webturbo', 886 'wvx' => 'video/x-ms-wvx', 887 'x32' => 'application/x-authorware-bin', 888 'x3d' => 'application/vnd.hzn-3d-crossword', 889 'xap' => 'application/x-silverlight-app', 890 'xar' => 'application/vnd.xara', 891 'xbap' => 'application/x-ms-xbap', 892 'xbd' => 'application/vnd.fujixerox.docuworks.binder', 893 'xbm' => 'image/x-xbitmap', 894 'xdf' => 'application/xcap-diff+xml', 895 'xdm' => 'application/vnd.syncml.dm+xml', 896 'xdp' => 'application/vnd.adobe.xdp+xml', 897 'xdssc' => 'application/dssc+xml', 898 'xdw' => 'application/vnd.fujixerox.docuworks', 899 'xenc' => 'application/xenc+xml', 900 'xer' => 'application/patch-ops-error+xml', 901 'xfdf' => 'application/vnd.adobe.xfdf', 902 'xfdl' => 'application/vnd.xfdl', 903 'xht' => 'application/xhtml+xml', 904 'xhtml' => 'application/xhtml+xml', 905 'xhvml' => 'application/xv+xml', 906 'xif' => 'image/vnd.xiff', 907 'xla' => 'application/vnd.ms-excel', 908 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12', 909 'xlc' => 'application/vnd.ms-excel', 910 'xlm' => 'application/vnd.ms-excel', 911 'xls' => 'application/vnd.ms-excel', 912 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12', 913 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12', 914 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 915 'xlt' => 'application/vnd.ms-excel', 916 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12', 917 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 918 'xlw' => 'application/vnd.ms-excel', 919 'xml' => 'application/xml', 920 'xo' => 'application/vnd.olpc-sugar', 921 'xop' => 'application/xop+xml', 922 'xpi' => 'application/x-xpinstall', 923 'xpm' => 'image/x-xpixmap', 924 'xpr' => 'application/vnd.is-xpr', 925 'xps' => 'application/vnd.ms-xpsdocument', 926 'xpw' => 'application/vnd.intercon.formnet', 927 'xpx' => 'application/vnd.intercon.formnet', 928 'xsl' => 'application/xml', 929 'xslt' => 'application/xslt+xml', 930 'xsm' => 'application/vnd.syncml+xml', 931 'xspf' => 'application/xspf+xml', 932 'xul' => 'application/vnd.mozilla.xul+xml', 933 'xvm' => 'application/xv+xml', 934 'xvml' => 'application/xv+xml', 935 'xwd' => 'image/x-xwindowdump', 936 'xyz' => 'chemical/x-xyz', 937 'yaml' => 'text/yaml', 938 'yang' => 'application/yang', 939 'yin' => 'application/yin+xml', 940 'yml' => 'text/yaml', 941 'zaz' => 'application/vnd.zzazz.deck+xml', 942 'zip' => 'application/zip', 943 'zir' => 'application/vnd.zul', 944 'zirz' => 'application/vnd.zul', 945 'zmm' => 'application/vnd.handheld-entertainment+xml' 946 ]; 947 948 /** 949 * Get a singleton instance of the class 950 * 951 * @return self 952 * @codeCoverageIgnore 953 */ 954 public static function getInstance() 955 { 956 if (!self::$instance) { 957 self::$instance = new self(); 958 } 959 960 return self::$instance; 961 } 962 963 /** 964 * Get a mimetype value from a file extension 965 * 966 * @param string $extension File extension 967 * 968 * @return string|null 969 */ 970 public function fromExtension($extension) 971 { 972 $extension = strtolower($extension); 973 974 return isset($this->mimetypes[$extension]) ? $this->mimetypes[$extension] : null; 975 } 976 977 /** 978 * Get a mimetype from a filename 979 * 980 * @param string $filename Filename to generate a mimetype from 981 * 982 * @return string|null 983 */ 984 public function fromFilename($filename) 985 { 986 return $this->fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); 987 } 988} 989