title: PHP / Mime Types - List of mime types publically available?
body: <p>I'm looking for an array, preferably php or json, that maps file extensions to mime types. This is intended to be a fallback for servers without Fileinfo, mime_content_type, or PEAR support.</p>
  
  <p>Here is my pathetic list atm...</p>
  
  <pre><code>// Fallback for servers without Fileinfo, mime_content_type, or PEAR support.
  
  $mime_types_map = array(
      '3dm' =&gt; 'x-world/x-3dmf', '3dmf' =&gt; 'x-world/x-3dmf', 'a' =&gt; 'application/octet-stream', 'aab' =&gt; 'application/x-authorware-bin',
      'aam' =&gt; 'application/x-authorware-map', 'aas' =&gt; 'application/x-authorware-seg', 'abc' =&gt; 'text/vnd.abc', 'acgi' =&gt; 'text/html',
      'afl' =&gt; 'video/animaflex', 'ai' =&gt; 'application/postscript', 'aif' =&gt; 'audio/aiff', 'aif' =&gt; 'audio/x-aiff',
      'aifc' =&gt; 'audio/aiff', 'aifc' =&gt; 'audio/x-aiff', 'aiff' =&gt; 'audio/aiff', 'aiff' =&gt; 'audio/x-aiff',
      'aim' =&gt; 'application/x-aim', 'aip' =&gt; 'text/x-audiosoft-intra', 'ani' =&gt; 'application/x-navi-animation', 'aos' =&gt; 'application/x-nokia-9000-communicator-add-on-software',
      'aps' =&gt; 'application/mime', 'arc' =&gt; 'application/octet-stream', 'arj' =&gt; 'application/arj', 'arj' =&gt; 'application/octet-stream',
      'art' =&gt; 'image/x-jg', 'asf' =&gt; 'video/x-ms-asf', 'asm' =&gt; 'text/x-asm', 'asp' =&gt; 'text/asp',
      'asx' =&gt; 'application/x-mplayer2', 'asx' =&gt; 'video/x-ms-asf', 'asx' =&gt; 'video/x-ms-asf-plugin', 'au' =&gt; 'audio/basic',
      'au' =&gt; 'audio/x-au', 'avi' =&gt; 'application/x-troff-msvideo', 'avi' =&gt; 'video/avi', 'avi' =&gt; 'video/msvideo',
      'avi' =&gt; 'video/x-msvideo', 'avs' =&gt; 'video/avs-video', 'bcpio' =&gt; 'application/x-bcpio', 'bin' =&gt; 'application/mac-binary',
      'bin' =&gt; 'application/macbinary', 'bin' =&gt; 'application/octet-stream', 'bin' =&gt; 'application/x-binary', 'bin' =&gt; 'application/x-macbinary',
      'bm' =&gt; 'image/bmp', 'bmp' =&gt; 'image/bmp', 'bmp' =&gt; 'image/x-windows-bmp', 'boo' =&gt; 'application/book',
      'book' =&gt; 'application/book', 'boz' =&gt; 'application/x-bzip2', 'bsh' =&gt; 'application/x-bsh', 'bz' =&gt; 'application/x-bzip',
      'bz2' =&gt; 'application/x-bzip2', 'c' =&gt; 'text/plain', 'c' =&gt; 'text/x-c', 'c++' =&gt; 'text/plain',
      'cat' =&gt; 'application/vnd.ms-pki.seccat', 'cc' =&gt; 'text/plain', 'cc' =&gt; 'text/x-c', 'ccad' =&gt; 'application/clariscad',
      'cco' =&gt; 'application/x-cocoa', 'cdf' =&gt; 'application/cdf', 'cdf' =&gt; 'application/x-cdf', 'cdf' =&gt; 'application/x-netcdf',
      'cer' =&gt; 'application/pkix-cert', 'cer' =&gt; 'application/x-x509-ca-cert', 'cha' =&gt; 'application/x-chat', 'chat' =&gt; 'application/x-chat',
      'class' =&gt; 'application/java', 'class' =&gt; 'application/java-byte-code', 'class' =&gt; 'application/x-java-class', 'com' =&gt; 'application/octet-stream',
      'com' =&gt; 'text/plain', 'conf' =&gt; 'text/plain', 'cpio' =&gt; 'application/x-cpio', 'cpp' =&gt; 'text/x-c',
      'cpt' =&gt; 'application/mac-compactpro', 'cpt' =&gt; 'application/x-compactpro', 'cpt' =&gt; 'application/x-cpt', 'crl' =&gt; 'application/pkcs-crl',
      'crl' =&gt; 'application/pkix-crl', 'crt' =&gt; 'application/pkix-cert', 'crt' =&gt; 'application/x-x509-ca-cert', 'crt' =&gt; 'application/x-x509-user-cert',
      'csh' =&gt; 'application/x-csh', 'csh' =&gt; 'text/x-script.csh', 'css' =&gt; 'application/x-pointplus', 'css' =&gt; 'text/css',
      'cxx' =&gt; 'text/plain', 'dcr' =&gt; 'application/x-director', 'deepv' =&gt; 'application/x-deepv', 'def' =&gt; 'text/plain',
      'der' =&gt; 'application/x-x509-ca-cert', 'dif' =&gt; 'video/x-dv', 'dir' =&gt; 'application/x-director', 'dl' =&gt; 'video/dl',
      'dl' =&gt; 'video/x-dl', 'doc' =&gt; 'application/msword', 'dot' =&gt; 'application/msword', 'dp' =&gt; 'application/commonground',
      'drw' =&gt; 'application/drafting', 'dump' =&gt; 'application/octet-stream', 'dv' =&gt; 'video/x-dv', 'dvi' =&gt; 'application/x-dvi',
      'dwf' =&gt; 'drawing/x-dwf', 'dwf' =&gt; 'model/vnd.dwf', 'dwg' =&gt; 'application/acad', 'dwg' =&gt; 'image/vnd.dwg',
      'dwg' =&gt; 'image/x-dwg', 'dxf' =&gt; 'application/dxf', 'dxf' =&gt; 'image/vnd.dwg', 'dxf' =&gt; 'image/x-dwg',
      'dxr' =&gt; 'application/x-director', 'el' =&gt; 'text/x-script.elisp', 'elc' =&gt; 'application/x-bytecode.elisp', 'elc' =&gt; 'application/x-elc',
      'env' =&gt; 'application/x-envoy', 'eps' =&gt; 'application/postscript', 'es' =&gt; 'application/x-esrehber', 'etx' =&gt; 'text/x-setext',
      'evy' =&gt; 'application/envoy', 'evy' =&gt; 'application/x-envoy', 'exe' =&gt; 'application/octet-stream', 'f' =&gt; 'text/plain',
      'f' =&gt; 'text/x-fortran', 'f77' =&gt; 'text/x-fortran', 'f90' =&gt; 'text/plain', 'f90' =&gt; 'text/x-fortran',
      'fdf' =&gt; 'application/vnd.fdf', 'fif' =&gt; 'application/fractals', 'fif' =&gt; 'image/fif', 'fli' =&gt; 'video/fli',
      'fli' =&gt; 'video/x-fli', 'flo' =&gt; 'image/florian', 'flx' =&gt; 'text/vnd.fmi.flexstor', 'fmf' =&gt; 'video/x-atomic3d-feature',
      'for' =&gt; 'text/plain', 'for' =&gt; 'text/x-fortran', 'fpx' =&gt; 'image/vnd.fpx', 'fpx' =&gt; 'image/vnd.net-fpx',
      'frl' =&gt; 'application/freeloader', 'funk' =&gt; 'audio/make', 'g' =&gt; 'text/plain', 'g3' =&gt; 'image/g3fax',
      'gif' =&gt; 'image/gif', 'gl' =&gt; 'video/gl', 'gl' =&gt; 'video/x-gl', 'gsd' =&gt; 'audio/x-gsm',
      'gsm' =&gt; 'audio/x-gsm', 'gsp' =&gt; 'application/x-gsp', 'gss' =&gt; 'application/x-gss', 'gtar' =&gt; 'application/x-gtar',
      'gz' =&gt; 'application/x-compressed', 'gz' =&gt; 'application/x-gzip', 'gzip' =&gt; 'application/x-gzip', 'gzip' =&gt; 'multipart/x-gzip',
      'h' =&gt; 'text/plain', 'h' =&gt; 'text/x-h', 'hdf' =&gt; 'application/x-hdf', 'help' =&gt; 'application/x-helpfile',
      'hgl' =&gt; 'application/vnd.hp-hpgl', 'hh' =&gt; 'text/plain', 'hh' =&gt; 'text/x-h', 'hlb' =&gt; 'text/x-script',
      'hlp' =&gt; 'application/hlp', 'hlp' =&gt; 'application/x-helpfile', 'hlp' =&gt; 'application/x-winhelp', 'hpg' =&gt; 'application/vnd.hp-hpgl',
      'hpgl' =&gt; 'application/vnd.hp-hpgl', 'hqx' =&gt; 'application/binhex', 'hqx' =&gt; 'application/binhex4', 'hqx' =&gt; 'application/mac-binhex',
      'hqx' =&gt; 'application/mac-binhex40', 'hqx' =&gt; 'application/x-binhex40', 'hqx' =&gt; 'application/x-mac-binhex40', 'hta' =&gt; 'application/hta',
      'htc' =&gt; 'text/x-component', 'htm' =&gt; 'text/html', 'html' =&gt; 'text/html', 'htmls' =&gt; 'text/html',
      'htt' =&gt; 'text/webviewhtml', 'htx' =&gt; 'text/html', 'ice' =&gt; 'x-conference/x-cooltalk', 'ico' =&gt; 'image/x-icon',
      'idc' =&gt; 'text/plain', 'ief' =&gt; 'image/ief', 'iefs' =&gt; 'image/ief', 'iges' =&gt; 'application/iges',
      'iges' =&gt; 'model/iges', 'igs' =&gt; 'application/iges', 'igs' =&gt; 'model/iges', 'ima' =&gt; 'application/x-ima',
      'imap' =&gt; 'application/x-httpd-imap', 'inf' =&gt; 'application/inf', 'ins' =&gt; 'application/x-internett-signup', 'ip' =&gt; 'application/x-ip2',
      'isu' =&gt; 'video/x-isvideo', 'it' =&gt; 'audio/it', 'iv' =&gt; 'application/x-inventor', 'ivr' =&gt; 'i-world/i-vrml',
      'ivy' =&gt; 'application/x-livescreen', 'jam' =&gt; 'audio/x-jam', 'jav' =&gt; 'text/plain', 'jav' =&gt; 'text/x-java-source',
      'java' =&gt; 'text/plain', 'java' =&gt; 'text/x-java-source', 'jcm' =&gt; 'application/x-java-commerce', 'jfif' =&gt; 'image/jpeg',
      'jfif' =&gt; 'image/pjpeg', 'jfif-tbnl' =&gt; 'image/jpeg', 'jpe' =&gt; 'image/jpeg', 'jpe' =&gt; 'image/pjpeg',
      'jpeg' =&gt; 'image/jpeg', 'jpeg' =&gt; 'image/pjpeg', 'jpg' =&gt; 'image/jpeg', 'jpg' =&gt; 'image/pjpeg',
      'jps' =&gt; 'image/x-jps', 'js' =&gt; 'application/x-javascript', 'jut' =&gt; 'image/jutvision', 'kar' =&gt; 'audio/midi',
      'kar' =&gt; 'music/x-karaoke', 'ksh' =&gt; 'application/x-ksh', 'ksh' =&gt; 'text/x-script.ksh', 'la' =&gt; 'audio/nspaudio',
      'la' =&gt; 'audio/x-nspaudio', 'lam' =&gt; 'audio/x-liveaudio', 'latex' =&gt; 'application/x-latex', 'lha' =&gt; 'application/lha',
      'lha' =&gt; 'application/octet-stream', 'lha' =&gt; 'application/x-lha', 'lhx' =&gt; 'application/octet-stream', 'list' =&gt; 'text/plain',
      'lma' =&gt; 'audio/nspaudio', 'lma' =&gt; 'audio/x-nspaudio', 'log' =&gt; 'text/plain', 'lsp' =&gt; 'application/x-lisp',
      'lsp' =&gt; 'text/x-script.lisp', 'lst' =&gt; 'text/plain', 'lsx' =&gt; 'text/x-la-asf', 'ltx' =&gt; 'application/x-latex',
      'lzh' =&gt; 'application/octet-stream', 'lzh' =&gt; 'application/x-lzh', 'lzx' =&gt; 'application/lzx', 'lzx' =&gt; 'application/octet-stream',
      'lzx' =&gt; 'application/x-lzx', 'm' =&gt; 'text/plain', 'm' =&gt; 'text/x-m', 'm1v' =&gt; 'video/mpeg',
      'm2a' =&gt; 'audio/mpeg', 'm2v' =&gt; 'video/mpeg', 'm3u' =&gt; 'audio/x-mpequrl', 'man' =&gt; 'application/x-troff-man',
      'map' =&gt; 'application/x-navimap', 'mar' =&gt; 'text/plain', 'mbd' =&gt; 'application/mbedlet', 'mc$' =&gt; 'application/x-magic-cap-package-1.0',
      'mcd' =&gt; 'application/mcad', 'mcd' =&gt; 'application/x-mathcad', 'mcf' =&gt; 'image/vasa', 'mcf' =&gt; 'text/mcf',
      'mcp' =&gt; 'application/netmc', 'me' =&gt; 'application/x-troff-me', 'mht' =&gt; 'message/rfc822', 'mhtml' =&gt; 'message/rfc822',
      'mid' =&gt; 'application/x-midi', 'mid' =&gt; 'audio/midi', 'mid' =&gt; 'audio/x-mid', 'mid' =&gt; 'audio/x-midi',
      'mid' =&gt; 'music/crescendo', 'mid' =&gt; 'x-music/x-midi', 'midi' =&gt; 'application/x-midi', 'midi' =&gt; 'audio/midi',
      'midi' =&gt; 'audio/x-mid', 'midi' =&gt; 'audio/x-midi', 'midi' =&gt; 'music/crescendo', 'midi' =&gt; 'x-music/x-midi',
      'mif' =&gt; 'application/x-frame', 'mif' =&gt; 'application/x-mif', 'mime' =&gt; 'message/rfc822', 'mime' =&gt; 'www/mime',
      'mjf' =&gt; 'audio/x-vnd.audioexplosion.mjuicemediafile', 'mjpg' =&gt; 'video/x-motion-jpeg', 'mm' =&gt; 'application/base64', 'mm' =&gt; 'application/x-meme',
      'mme' =&gt; 'application/base64', 'mod' =&gt; 'audio/mod', 'mod' =&gt; 'audio/x-mod', 'moov' =&gt; 'video/quicktime',
      'mov' =&gt; 'video/quicktime', 'movie' =&gt; 'video/x-sgi-movie', 'mp2' =&gt; 'audio/mpeg', 'mp2' =&gt; 'audio/x-mpeg',
      'mp2' =&gt; 'video/mpeg', 'mp2' =&gt; 'video/x-mpeg', 'mp2' =&gt; 'video/x-mpeq2a', 'mp3' =&gt; 'audio/mpeg3',
      'mp3' =&gt; 'audio/x-mpeg-3', 'mp3' =&gt; 'video/mpeg', 'mp3' =&gt; 'video/x-mpeg', 'mpa' =&gt; 'audio/mpeg',
      'mpa' =&gt; 'video/mpeg', 'mpc' =&gt; 'application/x-project', 'mpe' =&gt; 'video/mpeg', 'mpeg' =&gt; 'video/mpeg',
      'mpg' =&gt; 'audio/mpeg', 'mpg' =&gt; 'video/mpeg', 'mpga' =&gt; 'audio/mpeg', 'mpp' =&gt; 'application/vnd.ms-project',
      'mpt' =&gt; 'application/x-project', 'mpv' =&gt; 'application/x-project', 'mpx' =&gt; 'application/x-project', 'mrc' =&gt; 'application/marc',
      'ms' =&gt; 'application/x-troff-ms', 'mv' =&gt; 'video/x-sgi-movie', 'my' =&gt; 'audio/make', 'mzz' =&gt; 'application/x-vnd.audioexplosion.mzz',
      'nap' =&gt; 'image/naplps', 'naplps' =&gt; 'image/naplps', 'nc' =&gt; 'application/x-netcdf', 'ncm' =&gt; 'application/vnd.nokia.configuration-message',
      'nif' =&gt; 'image/x-niff', 'niff' =&gt; 'image/x-niff', 'nix' =&gt; 'application/x-mix-transfer', 'nsc' =&gt; 'application/x-conference',
      'nvd' =&gt; 'application/x-navidoc', 'o' =&gt; 'application/octet-stream', 'oda' =&gt; 'application/oda', 'omc' =&gt; 'application/x-omc',
      'omcd' =&gt; 'application/x-omcdatamaker', 'omcr' =&gt; 'application/x-omcregerator', 'p' =&gt; 'text/x-pascal', 'p10' =&gt; 'application/pkcs10',
      'p10' =&gt; 'application/x-pkcs10', 'p12' =&gt; 'application/pkcs-12', 'p12' =&gt; 'application/x-pkcs12', 'p7a' =&gt; 'application/x-pkcs7-signature',
      'p7c' =&gt; 'application/pkcs7-mime', 'p7c' =&gt; 'application/x-pkcs7-mime', 'p7m' =&gt; 'application/pkcs7-mime', 'p7m' =&gt; 'application/x-pkcs7-mime',
      'p7r' =&gt; 'application/x-pkcs7-certreqresp', 'p7s' =&gt; 'application/pkcs7-signature', 'part' =&gt; 'application/pro_eng', 'pas' =&gt; 'text/pascal',
      'pbm' =&gt; 'image/x-portable-bitmap', 'pcl' =&gt; 'application/vnd.hp-pcl', 'pcl' =&gt; 'application/x-pcl', 'pct' =&gt; 'image/x-pict',
      'pcx' =&gt; 'image/x-pcx', 'pdb' =&gt; 'chemical/x-pdb', 'pdf' =&gt; 'application/pdf', 'pfunk' =&gt; 'audio/make',
      'pfunk' =&gt; 'audio/make.my.funk', 'pgm' =&gt; 'image/x-portable-graymap', 'pgm' =&gt; 'image/x-portable-greymap', 'pic' =&gt; 'image/pict',
      'pict' =&gt; 'image/pict', 'pkg' =&gt; 'application/x-newton-compatible-pkg', 'pko' =&gt; 'application/vnd.ms-pki.pko', 'pl' =&gt; 'text/plain',
      'pl' =&gt; 'text/x-script.perl', 'plx' =&gt; 'application/x-pixclscript', 'pm' =&gt; 'image/x-xpixmap', 'pm' =&gt; 'text/x-script.perl-module',
      'pm4' =&gt; 'application/x-pagemaker', 'pm5' =&gt; 'application/x-pagemaker', 'png' =&gt; 'image/png', 'pnm' =&gt; 'application/x-portable-anymap',
      'pnm' =&gt; 'image/x-portable-anymap', 'pot' =&gt; 'application/mspowerpoint', 'pot' =&gt; 'application/vnd.ms-powerpoint', 'pov' =&gt; 'model/x-pov',
      'ppa' =&gt; 'application/vnd.ms-powerpoint', 'ppm' =&gt; 'image/x-portable-pixmap', 'pps' =&gt; 'application/mspowerpoint', 'pps' =&gt; 'application/vnd.ms-powerpoint',
      'ppt' =&gt; 'application/mspowerpoint', 'ppt' =&gt; 'application/powerpoint', 'ppt' =&gt; 'application/vnd.ms-powerpoint', 'ppt' =&gt; 'application/x-mspowerpoint',
      'ppz' =&gt; 'application/mspowerpoint', 'pre' =&gt; 'application/x-freelance', 'prt' =&gt; 'application/pro_eng', 'ps' =&gt; 'application/postscript',
      'psd' =&gt; 'application/octet-stream', 'pvu' =&gt; 'paleovu/x-pv', 'pwz' =&gt; 'application/vnd.ms-powerpoint', 'py' =&gt; 'text/x-script.phyton',
      'pyc' =&gt; 'applicaiton/x-bytecode.python', 'qcp' =&gt; 'audio/vnd.qcelp', 'qd3' =&gt; 'x-world/x-3dmf', 'qd3d' =&gt; 'x-world/x-3dmf',
      'qif' =&gt; 'image/x-quicktime', 'qt' =&gt; 'video/quicktime', 'qtc' =&gt; 'video/x-qtc', 'qti' =&gt; 'image/x-quicktime',
      'qtif' =&gt; 'image/x-quicktime', 'ra' =&gt; 'audio/x-pn-realaudio', 'ra' =&gt; 'audio/x-pn-realaudio-plugin', 'ra' =&gt; 'audio/x-realaudio',
      'ram' =&gt; 'audio/x-pn-realaudio', 'ras' =&gt; 'application/x-cmu-raster', 'ras' =&gt; 'image/cmu-raster', 'ras' =&gt; 'image/x-cmu-raster',
      'rast' =&gt; 'image/cmu-raster', 'rexx' =&gt; 'text/x-script.rexx', 'rf' =&gt; 'image/vnd.rn-realflash', 'rgb' =&gt; 'image/x-rgb',
      'rm' =&gt; 'application/vnd.rn-realmedia', 'rm' =&gt; 'audio/x-pn-realaudio', 'rmi' =&gt; 'audio/mid', 'rmm' =&gt; 'audio/x-pn-realaudio',
      'rmp' =&gt; 'audio/x-pn-realaudio', 'rmp' =&gt; 'audio/x-pn-realaudio-plugin', 'rng' =&gt; 'application/ringing-tones', 'rng' =&gt; 'application/vnd.nokia.ringing-tone',
      'rnx' =&gt; 'application/vnd.rn-realplayer', 'roff' =&gt; 'application/x-troff', 'rp' =&gt; 'image/vnd.rn-realpix', 'rpm' =&gt; 'audio/x-pn-realaudio-plugin',
      'rt' =&gt; 'text/richtext', 'rt' =&gt; 'text/vnd.rn-realtext', 'rtf' =&gt; 'application/rtf', 'rtf' =&gt; 'application/x-rtf',
      'rtf' =&gt; 'text/richtext', 'rtx' =&gt; 'application/rtf', 'rtx' =&gt; 'text/richtext', 'rv' =&gt; 'video/vnd.rn-realvideo',
      's' =&gt; 'text/x-asm', 's3m' =&gt; 'audio/s3m', 'saveme' =&gt; 'application/octet-stream', 'sbk' =&gt; 'application/x-tbook',
      'scm' =&gt; 'application/x-lotusscreencam', 'scm' =&gt; 'text/x-script.guile', 'scm' =&gt; 'text/x-script.scheme', 'scm' =&gt; 'video/x-scm',
      'sdml' =&gt; 'text/plain', 'sdp' =&gt; 'application/sdp', 'sdp' =&gt; 'application/x-sdp', 'sdr' =&gt; 'application/sounder',
      'sea' =&gt; 'application/sea', 'sea' =&gt; 'application/x-sea', 'set' =&gt; 'application/set', 'sgm' =&gt; 'text/sgml',
      'sgm' =&gt; 'text/x-sgml', 'sgml' =&gt; 'text/sgml', 'sgml' =&gt; 'text/x-sgml', 'sh' =&gt; 'application/x-bsh',
      'sh' =&gt; 'application/x-sh', 'sh' =&gt; 'application/x-shar', 'sh' =&gt; 'text/x-script.sh', 'shar' =&gt; 'application/x-bsh',
      'shar' =&gt; 'application/x-shar', 'shtml' =&gt; 'text/html', 'shtml' =&gt; 'text/x-server-parsed-html', 'sid' =&gt; 'audio/x-psid',
      'sit' =&gt; 'application/x-sit', 'sit' =&gt; 'application/x-stuffit', 'skd' =&gt; 'application/x-koan', 'skm' =&gt; 'application/x-koan',
      'skp' =&gt; 'application/x-koan', 'skt' =&gt; 'application/x-koan', 'sl' =&gt; 'application/x-seelogo', 'smi' =&gt; 'application/smil',
      'smil' =&gt; 'application/smil', 'snd' =&gt; 'audio/basic', 'snd' =&gt; 'audio/x-adpcm', 'sol' =&gt; 'application/solids',
      'spc' =&gt; 'application/x-pkcs7-certificates', 'spc' =&gt; 'text/x-speech', 'spl' =&gt; 'application/futuresplash', 'spr' =&gt; 'application/x-sprite',
      'sprite' =&gt; 'application/x-sprite', 'src' =&gt; 'application/x-wais-source', 'ssi' =&gt; 'text/x-server-parsed-html', 'ssm' =&gt; 'application/streamingmedia',
      'sst' =&gt; 'application/vnd.ms-pki.certstore', 'step' =&gt; 'application/step', 'stl' =&gt; 'application/sla', 'stl' =&gt; 'application/vnd.ms-pki.stl',
      'stl' =&gt; 'application/x-navistyle', 'stp' =&gt; 'application/step', 'sv4cpio' =&gt; 'application/x-sv4cpio', 'sv4crc' =&gt; 'application/x-sv4crc',
      'svf' =&gt; 'image/vnd.dwg', 'svf' =&gt; 'image/x-dwg', 'svr' =&gt; 'application/x-world', 'svr' =&gt; 'x-world/x-svr',
      'swf' =&gt; 'application/x-shockwave-flash', 't' =&gt; 'application/x-troff', 'talk' =&gt; 'text/x-speech', 'tar' =&gt; 'application/x-tar',
      'tbk' =&gt; 'application/toolbook', 'tbk' =&gt; 'application/x-tbook', 'tcl' =&gt; 'application/x-tcl', 'tcl' =&gt; 'text/x-script.tcl',
      'tcsh' =&gt; 'text/x-script.tcsh', 'tex' =&gt; 'application/x-tex', 'texi' =&gt; 'application/x-texinfo', 'texinfo' =&gt; 'application/x-texinfo',
      'text' =&gt; 'application/plain', 'text' =&gt; 'text/plain', 'tgz' =&gt; 'application/gnutar', 'tgz' =&gt; 'application/x-compressed',
      'tif' =&gt; 'image/tiff', 'tif' =&gt; 'image/x-tiff', 'tiff' =&gt; 'image/tiff', 'tiff' =&gt; 'image/x-tiff',
      'tr' =&gt; 'application/x-troff', 'tsi' =&gt; 'audio/tsp-audio', 'tsp' =&gt; 'application/dsptype', 'tsp' =&gt; 'audio/tsplayer',
      'tsv' =&gt; 'text/tab-separated-values', 'turbot' =&gt; 'image/florian', 'txt' =&gt; 'text/plain', 'uil' =&gt; 'text/x-uil',
      'uni' =&gt; 'text/uri-list', 'unis' =&gt; 'text/uri-list', 'unv' =&gt; 'application/i-deas', 'uri' =&gt; 'text/uri-list',
      'uris' =&gt; 'text/uri-list', 'ustar' =&gt; 'application/x-ustar', 'ustar' =&gt; 'multipart/x-ustar', 'uu' =&gt; 'application/octet-stream',
      'uu' =&gt; 'text/x-uuencode', 'uue' =&gt; 'text/x-uuencode', 'vcd' =&gt; 'application/x-cdlink', 'vcs' =&gt; 'text/x-vcalendar',
      'vda' =&gt; 'application/vda', 'vdo' =&gt; 'video/vdo', 'vew' =&gt; 'application/groupwise', 'viv' =&gt; 'video/vivo',
      'viv' =&gt; 'video/vnd.vivo', 'vivo' =&gt; 'video/vivo', 'vivo' =&gt; 'video/vnd.vivo', 'vmd' =&gt; 'application/vocaltec-media-desc',
      'vmf' =&gt; 'application/vocaltec-media-file', 'voc' =&gt; 'audio/voc', 'voc' =&gt; 'audio/x-voc', 'vos' =&gt; 'video/vosaic',
      'vox' =&gt; 'audio/voxware', 'vqe' =&gt; 'audio/x-twinvq-plugin', 'vqf' =&gt; 'audio/x-twinvq', 'vql' =&gt; 'audio/x-twinvq-plugin',
      'vrml' =&gt; 'application/x-vrml', 'vrml' =&gt; 'model/vrml', 'vrml' =&gt; 'x-world/x-vrml', 'vrt' =&gt; 'x-world/x-vrt',
      'vsd' =&gt; 'application/x-visio', 'vst' =&gt; 'application/x-visio', 'vsw' =&gt; 'application/x-visio', 'w60' =&gt; 'application/wordperfect6.0',
      'w61' =&gt; 'application/wordperfect6.1', 'w6w' =&gt; 'application/msword', 'wav' =&gt; 'audio/wav', 'wav' =&gt; 'audio/x-wav',
      'wb1' =&gt; 'application/x-qpro', 'wbmp' =&gt; 'image/vnd.wap.wbmp', 'web' =&gt; 'application/vnd.xara', 'wiz' =&gt; 'application/msword',
      'wk1' =&gt; 'application/x-123', 'wmf' =&gt; 'windows/metafile', 'wml' =&gt; 'text/vnd.wap.wml', 'wmlc' =&gt; 'application/vnd.wap.wmlc',
      'wmls' =&gt; 'text/vnd.wap.wmlscript', 'wmlsc' =&gt; 'application/vnd.wap.wmlscriptc', 'word' =&gt; 'application/msword', 'wp' =&gt; 'application/wordperfect',
      'wp5' =&gt; 'application/wordperfect', 'wp5' =&gt; 'application/wordperfect6.0', 'wp6' =&gt; 'application/wordperfect', 'wpd' =&gt; 'application/wordperfect',
      'wpd' =&gt; 'application/x-wpwin', 'wq1' =&gt; 'application/x-lotus', 'wri' =&gt; 'application/mswrite', 'wri' =&gt; 'application/x-wri',
      'wrl' =&gt; 'application/x-world', 'wrl' =&gt; 'model/vrml', 'wrl' =&gt; 'x-world/x-vrml', 'wrz' =&gt; 'model/vrml',
      'wrz' =&gt; 'x-world/x-vrml', 'wsc' =&gt; 'text/scriplet', 'wsrc' =&gt; 'application/x-wais-source', 'wtk' =&gt; 'application/x-wintalk',
      'xbm' =&gt; 'image/x-xbitmap', 'xbm' =&gt; 'image/x-xbm', 'xbm' =&gt; 'image/xbm', 'xdr' =&gt; 'video/x-amt-demorun',
      'xgz' =&gt; 'xgl/drawing', 'xif' =&gt; 'image/vnd.xiff', 'xl' =&gt; 'application/excel', 'xla' =&gt; 'application/excel',
      'xla' =&gt; 'application/x-excel', 'xla' =&gt; 'application/x-msexcel', 'xlb' =&gt; 'application/excel', 'xlb' =&gt; 'application/vnd.ms-excel',
      'xlb' =&gt; 'application/x-excel', 'xlc' =&gt; 'application/excel', 'xlc' =&gt; 'application/vnd.ms-excel', 'xlc' =&gt; 'application/x-excel',
      'xld' =&gt; 'application/excel', 'xld' =&gt; 'application/x-excel', 'xlk' =&gt; 'application/excel', 'xlk' =&gt; 'application/x-excel',
      'xll' =&gt; 'application/excel', 'xll' =&gt; 'application/vnd.ms-excel', 'xll' =&gt; 'application/x-excel', 'xlm' =&gt; 'application/excel',
      'xlm' =&gt; 'application/vnd.ms-excel', 'xlm' =&gt; 'application/x-excel', 'xls' =&gt; 'application/excel', 'xls' =&gt; 'application/vnd.ms-excel',
      'xls' =&gt; 'application/x-excel', 'xls' =&gt; 'application/x-msexcel', 'xlt' =&gt; 'application/excel', 'xlt' =&gt; 'application/x-excel',
      'xlv' =&gt; 'application/excel', 'xlv' =&gt; 'application/x-excel', 'xlw' =&gt; 'application/excel', 'xlw' =&gt; 'application/vnd.ms-excel',
      'xlw' =&gt; 'application/x-excel', 'xlw' =&gt; 'application/x-msexcel', 'xm' =&gt; 'audio/xm', 'xml' =&gt; 'application/xml',
      'xml' =&gt; 'text/xml', 'xmz' =&gt; 'xgl/movie', 'xpix' =&gt; 'application/x-vnd.ls-xpix', 'xpm' =&gt; 'image/x-xpixmap',
      'xpm' =&gt; 'image/xpm', 'x-png' =&gt; 'image/png', 'xsr' =&gt; 'video/x-amt-showrun', 'xwd' =&gt; 'image/x-xwd',
      'xwd' =&gt; 'image/x-xwindowdump', 'xyz' =&gt; 'chemical/x-pdb', 'z' =&gt; 'application/x-compress', 'z' =&gt; 'application/x-compressed',
      'zip' =&gt; 'application/x-compressed', 'zip' =&gt; 'application/x-zip-compressed', 'zip' =&gt; 'application/zip', 'zip' =&gt; 'multipart/x-zip',
      'zoo' =&gt; 'application/octet-stream', 'zsh' =&gt; 'text/x-script.zsh',
  );
  </code></pre>
  
  <p>Edit: This script is for a buddy who isn't php/apache savvy. I don't know where it will be deployed - so I can't install PEAR or anything.</p>
  
  <p>Edit2: Updated array from list in rfausak's comment - <a href="http://www.webmaster-toolkit.com/mime-types.shtml" rel="noreferrer">http://www.webmaster-toolkit.com/mime-types.shtml</a></p>