<?php
/****************************************
MimeTypes library
Written by Mark Wilton-Jones - 29/04/2003
*****************************************
Please see http://www.howtocreate.co.uk/php/ for details
Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms and conditions of use
If you have not, or cannot compile PHP with the --enable-mime-magic (PHP 4.3.1-) or --with-mime-magic (PHP 4.3.2+)
command line switches, this library provides the function 'ext2mime', which can be used to emulate the
mime_content_type function. It relies ONLY on the file extension so it is significantly inferior to the correct
method (on UNIX at least), but is the best I can do.
Simply put
require('giveMimeType.php');
at the start of the PHP file that needs it.
_________________________________________________________________________________________________________________*/
$MWJma = Array();
$MWJma['3dm'] = 'x-world/x-3dmf';
$MWJma['3dmf'] = 'x-world/x-3dmf';
$MWJma['a'] = 'application/octet-stream';
$MWJma['aab'] = 'application/x-authorware-bin';
$MWJma['aam'] = 'application/x-authorware-map';
$MWJma['aas'] = 'application/x-authorware-seg';
$MWJma['abc'] = 'text/vnd.abc';
$MWJma['acgi'] = 'text/html';
$MWJma['afl'] = 'video/animaflex';
$MWJma['ai'] = 'application/postscript';
$MWJma['aif'] = 'audio/aiff';
$MWJma['aifc'] = 'audio/aiff';
$MWJma['aiff'] = 'audio/aiff';
$MWJma['aim'] = 'application/x-aim';
$MWJma['aip'] = 'text/x-audiosoft-intra';
$MWJma['ani'] = 'application/x-navi-animation';
$MWJma['aos'] = 'application/x-nokia-9000-communicator-add-on-software';
$MWJma['aps'] = 'application/mime';
$MWJma['arc'] = 'application/octet-stream';
$MWJma['arj'] = 'application/arj';
$MWJma['art'] = 'image/x-jg';
$MWJma['asf'] = 'video/x-ms-asf';
$MWJma['asm'] = 'text/x-asm';
$MWJma['asp'] = 'text/asp';
$MWJma['asx'] = 'application/x-mplayer2';
$MWJma['au'] = 'audio/basic';
$MWJma['avi'] = 'video/msvideo';
$MWJma['avs'] = 'video/avs-video';
$MWJma['bcpio'] = 'application/x-bcpio';
$MWJma['bin'] = 'application/octet-stream';
$MWJma['bm'] = 'image/bmp';
$MWJma['bmp'] = 'image/bmp';
$MWJma['boo'] = 'application/book';
$MWJma['book'] = 'application/book';
$MWJma['boz'] = 'application/x-bzip2';
$MWJma['bsh'] = 'application/x-bsh';
$MWJma['bz'] = 'application/x-bzip';
$MWJma['bz2'] = 'application/x-bzip2';
$MWJma['c'] = 'text/plain';
$MWJma['c++'] = 'text/plain';
$MWJma['cat'] = 'application/vnd.ms-pki.seccat';
$MWJma['cc'] = 'text/plain';
$MWJma['ccad'] = 'application/clariscad';
$MWJma['cco'] = 'application/x-cocoa';
$MWJma['cdf'] = 'application/cdf';
$MWJma['cer'] = 'application/pkix-cert';
$MWJma['cha'] = 'application/x-chat';
$MWJma['chat'] = 'application/x-chat';
$MWJma['class'] = 'application/java';
$MWJma['com'] = 'application/octet-stream';
$MWJma['conf'] = 'text/plain';
$MWJma['cpio'] = 'application/x-cpio';
$MWJma['cpp'] = 'text/x-c';
$MWJma['cpt'] = 'application/mac-compactpro';
$MWJma['crl'] = 'application/pkcs-crl';
$MWJma['crt'] = 'application/pkix-cert';
$MWJma['csh'] = 'application/x-csh';
$MWJma['css'] = 'text/css';
$MWJma['cxx'] = 'text/plain';
$MWJma['dcr'] = 'application/x-director';
$MWJma['deepv'] = 'application/x-deepv';
$MWJma['def'] = 'text/plain';
$MWJma['der'] = 'application/x-x509-ca-cert';
$MWJma['dif'] = 'video/x-dv';
$MWJma['dir'] = 'application/x-director';
$MWJma['dl'] = 'video/dl';
$MWJma['doc'] = 'application/msword';
$MWJma['dot'] = 'application/msword';
$MWJma['dp'] = 'application/commonground';
$MWJma['drw'] = 'application/drafting';
$MWJma['dump'] = 'application/octet-stream';
$MWJma['dv'] = 'video/x-dv';
$MWJma['dvi'] = 'application/x-dvi';
$MWJma['dwf'] = 'model/vnd.dwf';
$MWJma['dwg'] = 'application/acad';
$MWJma['dxf'] = 'image/x-dwg';
$MWJma['dxr'] = 'application/x-director';
$MWJma['el'] = 'text/x-script.elisp';
$MWJma['elc'] = 'application/x-elc';
$MWJma['eml'] = 'message/rfc822';
$MWJma['env'] = 'application/x-envoy';
$MWJma['eps'] = 'application/postscript';
$MWJma['es'] = 'application/x-esrehber';
$MWJma['esp'] = 'text/html';
$MWJma['etx'] = 'text/x-setext';
$MWJma['evy'] = 'application/envoy';
$MWJma['exe'] = 'application/octet-stream';
$MWJma['f'] = 'text/plain';
$MWJma['f77'] = 'text/x-fortran';
$MWJma['f90'] = 'text/plain';
$MWJma['f90'] = 'text/x-fortran';
$MWJma['fdf'] = 'application/vnd.fdf';
$MWJma['fif'] = 'image/fif';
$MWJma['fli'] = 'video/fli';
$MWJma['flo'] = 'image/florian';
$MWJma['flx'] = 'text/vnd.fmi.flexstor';
$MWJma['fmf'] = 'video/x-atomic3d-feature';
$MWJma['for'] = 'text/plain';
$MWJma['fpx'] = 'image/vnd.fpx';
$MWJma['frl'] = 'application/freeloader';
$MWJma['funk'] = 'audio/make';
$MWJma['g'] = 'text/plain';
$MWJma['g3'] = 'image/g3fax';
$MWJma['gif'] = 'image/gif';
$MWJma['gl'] = 'video/gl';
$MWJma['gl'] = 'video/x-gl';
$MWJma['gsd'] = 'audio/x-gsm';
$MWJma['gsm'] = 'audio/x-gsm';
$MWJma['gsp'] = 'application/x-gsp';
$MWJma['gss'] = 'application/x-gss';
$MWJma['gtar'] = 'application/x-gtar';
$MWJma['gz'] = 'application/x-gzip';
$MWJma['gzip'] = 'application/x-gzip';
$MWJma['h'] = 'text/plain';
$MWJma['hdf'] = 'application/x-hdf';
$MWJma['help'] = 'application/x-helpfile';
$MWJma['hgl'] = 'application/vnd.hp-HPGL';
$MWJma['hh'] = 'text/plain';
$MWJma['hlb'] = 'text/x-script';
$MWJma['hlp'] = 'application/hlp';
$MWJma['hpg'] = 'application/vnd.hp-HPGL';
$MWJma['hpgl'] = 'application/vnd.hp-HPGL';
$MWJma['hqx'] = 'application/binhex';
$MWJma['hta'] = 'application/hta';
$MWJma['htc'] = 'text/x-component';
$MWJma['htm'] = 'text/html';
$MWJma['html'] = 'text/html';
$MWJma['htmls'] = 'text/html';
$MWJma['htt'] = 'text/webviewhtml';
$MWJma['htx'] = 'text/html';
$MWJma['ice'] = 'x-conference/x-cooltalk';
$MWJma['ico'] = 'image/x-icon';
$MWJma['idc'] = 'text/plain';
$MWJma['ief'] = 'image/ief';
$MWJma['iefs'] = 'image/ief';
$MWJma['iges'] = 'application/iges';
$MWJma['igs'] = 'application/iges';
$MWJma['ima'] = 'application/x-ima';
$MWJma['imap'] = 'application/x-httpd-imap';
$MWJma['inf'] = 'application/inf';
$MWJma['ins'] = 'application/x-internett-signup';
$MWJma['ip'] = 'application/x-ip2';
$MWJma['isu'] = 'video/x-isvideo';
$MWJma['it'] = 'audio/it';
$MWJma['iv'] = 'application/x-inventor';
$MWJma['ivr'] = 'i-world/i-vrml';
$MWJma['ivy'] = 'application/x-livescreen';
$MWJma['jam'] = 'audio/x-jam';
$MWJma['jav'] = 'text/plain';
$MWJma['java'] = 'text/plain';
$MWJma['jcm'] = 'application/x-java-commerce';
$MWJma['jfif'] = 'image/jpeg';
$MWJma['jfif-tbnl'] = 'image/jpeg';
$MWJma['jpe'] = 'image/jpeg';
$MWJma['jpeg'] = 'image/jpeg';
$MWJma['jpg'] = 'image/jpeg';
$MWJma['jps'] = 'image/x-jps';
$MWJma['js'] = 'application/x-javascript';
$MWJma['jsp'] = 'text/html';
$MWJma['jut'] = 'image/jutvision';
$MWJma['kar'] = 'audio/midi';
$MWJma['ksh'] = 'application/x-ksh';
$MWJma['la'] = 'audio/nspaudio';
$MWJma['lam'] = 'audio/x-liveaudio';
$MWJma['latex'] = 'application/x-latex';
$MWJma['lha'] = 'application/octet-stream';
$MWJma['lhx'] = 'application/octet-stream';
$MWJma['list'] = 'text/plain';
$MWJma['lma'] = 'audio/nspaudio';
$MWJma['log'] = 'text/plain';
$MWJma['lsp'] = 'application/x-lisp';
$MWJma['lst'] = 'text/plain';
$MWJma['lsx'] = 'text/x-la-asf';
$MWJma['ltx'] = 'application/x-latex';
$MWJma['lzh'] = 'application/octet-stream';
$MWJma['lzx'] = 'application/octet-stream';
$MWJma['m'] = 'text/plain';
$MWJma['m'] = 'text/x-m';
$MWJma['m1v'] = 'video/mpeg';
$MWJma['m2a'] = 'audio/mpeg';
$MWJma['m2v'] = 'video/mpeg';
$MWJma['m3u'] = 'audio/x-mpequrl';
$MWJma['man'] = 'application/x-troff-man';
$MWJma['map'] = 'application/x-navimap';
$MWJma['mar'] = 'text/plain';
$MWJma['mbd'] = 'application/mbedlet';
$MWJma['mc$'] = 'application/x-magic-cap-package-1.0';
$MWJma['mcd'] = 'application/mcad';
$MWJma['mcf'] = 'text/mcf';
$MWJma['mcp'] = 'application/netmc';
$MWJma['me'] = 'application/x-troff-me';
$MWJma['mht'] = 'message/rfc822';
$MWJma['mhtml'] = 'message/rfc822';
$MWJma['mid'] = 'audio/midi';
$MWJma['midi'] = 'audio/midi';
$MWJma['mif'] = 'application/x-frame';
$MWJma['mime'] = 'message/rfc822';
$MWJma['mjf'] = 'audio/x-vnd.AudioExplosion.MjuiceMediaFile';
$MWJma['mjpg'] = 'video/x-motion-jpeg';
$MWJma['mm'] = 'application/base64';
$MWJma['mme'] = 'application/base64';
$MWJma['mod'] = 'audio/mod';
$MWJma['moov'] = 'video/quicktime';
$MWJma['mov'] = 'video/quicktime';
$MWJma['movie'] = 'video/x-sgi-movie';
$MWJma['mp2'] = 'audio/mpeg';
$MWJma['mp3'] = 'audio/mpeg3';
$MWJma['mpa'] = 'audio/mpeg';
$MWJma['mpc'] = 'application/x-project';
$MWJma['mpe'] = 'video/mpeg';
$MWJma['mpeg'] = 'video/mpeg';
$MWJma['mpg'] = 'audio/mpeg';
$MWJma['mpga'] = 'audio/mpeg';
$MWJma['mpp'] = 'application/vnd.ms-project';
$MWJma['mpt'] = 'application/x-project';
$MWJma['mpv'] = 'application/x-project';
$MWJma['mpx'] = 'application/x-project';
$MWJma['mrc'] = 'application/marc';
$MWJma['ms'] = 'application/x-troff-ms';
$MWJma['mv'] = 'video/x-sgi-movie';
$MWJma['my'] = 'audio/make';
$MWJma['mzz'] = 'application/x-vnd.AudioExplosion.mzz';
$MWJma['nap'] = 'image/naplps';
$MWJma['naplps'] = 'image/naplps';
$MWJma['nc'] = 'application/x-netcdf';
$MWJma['ncm'] = 'application/vnd.nokia.configuration-message';
$MWJma['nif'] = 'image/x-niff';
$MWJma['niff'] = 'image/x-niff';
$MWJma['nix'] = 'application/x-mix-transfer';
$MWJma['nsc'] = 'application/x-conference';
$MWJma['nvd'] = 'application/x-navidoc';
$MWJma['o'] = 'application/octet-stream';
$MWJma['oda'] = 'application/oda';
$MWJma['omc'] = 'application/x-omc';
$MWJma['omcd'] = 'application/x-omcdatamaker';
$MWJma['omcr'] = 'application/x-omcregerator';
$MWJma['p'] = 'text/x-pascal';
$MWJma['p10'] = 'application/pkcs10';
$MWJma['p12'] = 'application/pkcs-12';
$MWJma['p7a'] = 'application/x-pkcs7-signature';
$MWJma['p7c'] = 'application/pkcs7-mime';
$MWJma['p7m'] = 'application/pkcs7-mime';
$MWJma['p7r'] = 'application/x-pkcs7-certreqresp';
$MWJma['p7s'] = 'application/pkcs7-signature';
$MWJma['part'] = 'application/pro_eng';
$MWJma['pas'] = 'text/pascal';
$MWJma['pbm'] = 'image/x-portable-bitmap';
$MWJma['pcl'] = 'application/x-pcl';
$MWJma['pct'] = 'image/x-pict';
$MWJma['pcx'] = 'image/x-pcx';
$MWJma['pdb'] = 'chemical/x-pdb';
$MWJma['pdf'] = 'application/pdf';
$MWJma['pfunk'] = 'audio/make';
$MWJma['pgm'] = 'image/x-portable-greymap';
$MWJma['php'] = 'application/x-httpd-php';
$MWJma['php3'] = 'text/html';
$MWJma['php4'] = 'text/html';
$MWJma['phps'] = 'text/html';
$MWJma['phtml'] = 'text/html';
$MWJma['pic'] = 'image/pict';
$MWJma['pict'] = 'image/pict';
$MWJma['pkg'] = 'application/x-newton-compatible-pkg';
$MWJma['pko'] = 'application/vnd.ms-pki.pko';
$MWJma['pl'] = 'text/plain';
$MWJma['plx'] = 'application/x-PiXCLscript';
$MWJma['pm'] = 'image/x-xpixmap';
$MWJma['pm4 '] = 'application/x-pagemaker';
$MWJma['pm5'] = 'application/x-pagemaker';
$MWJma['png'] = 'image/png';
$MWJma['pnm'] = 'application/x-portable-anymap';
$MWJma['pot'] = 'application/mspowerpoint';
$MWJma['pov'] = 'model/x-pov';
$MWJma['ppa'] = 'application/vnd.ms-powerpoint';
$MWJma['ppm'] = 'image/x-portable-pixmap';
$MWJma['pps'] = 'application/mspowerpoint';
$MWJma['ppt'] = 'application/mspowerpoint';
$MWJma['ppz'] = 'application/mspowerpoint';
$MWJma['pre'] = 'application/x-freelance';
$MWJma['prt'] = 'application/pro_eng';
$MWJma['ps'] = 'application/postscript';
$MWJma['psd'] = 'application/octet-stream';
$MWJma['pvu'] = 'paleovu/x-pv';
$MWJma['pwz'] = 'application/vnd.ms-powerpoint';
$MWJma['py'] = 'text/x-script.phyton';
$MWJma['pyc'] = 'applicaiton/x-bytecode.python';
$MWJma['qcp'] = 'audio/vnd.qcelp';
$MWJma['qd3'] = 'x-world/x-3dmf';
$MWJma['qd3d'] = 'x-world/x-3dmf';
$MWJma['qif'] = 'image/x-quicktime';
$MWJma['qt'] = 'video/quicktime';
$MWJma['qtc'] = 'video/x-qtc';
$MWJma['qti'] = 'image/x-quicktime';
$MWJma['qtif'] = 'image/x-quicktime';
$MWJma['ra'] = 'audio/x-realaudio';
$MWJma['ram'] = 'audio/x-pn-realaudio';
$MWJma['ras'] = 'image/cmu-raster';
$MWJma['rast'] = 'image/cmu-raster';
$MWJma['rex'] = 'text/x-script.rexx';
$MWJma['rexx'] = 'text/x-script.rexx';
$MWJma['rf'] = 'image/vnd.rn-realflash';
$MWJma['rgb'] = 'image/x-rgb';
$MWJma['rm'] = 'audio/x-pn-realaudio';
$MWJma['rmi'] = 'audio/mid';
$MWJma['rmm'] = 'audio/x-pn-realaudio';
$MWJma['rmp'] = 'audio/x-pn-realaudio';
$MWJma['rng'] = 'application/ringing-tones';
$MWJma['rng'] = 'application/vnd.nokia.ringing-tone';
$MWJma['rnx'] = 'application/vnd.rn-realplayer';
$MWJma['roff'] = 'application/x-troff';
$MWJma['rp'] = 'image/vnd.rn-realpix';
$MWJma['rpm'] = 'audio/x-pn-realaudio-plugin';
$MWJma['rt'] = 'text/richtext';
$MWJma['rtf'] = 'application/rtf';
$MWJma['rtx'] = 'application/rtf';
$MWJma['rv'] = 'video/vnd.rn-realvideo';
$MWJma['s'] = 'text/x-asm';
$MWJma['s3m'] = 'audio/s3m';
$MWJma['saveme'] = 'application/octet-stream';
$MWJma['sbk'] = 'application/x-tbook';
$MWJma['scm'] = 'application/x-lotusscreencam';
$MWJma['sdml'] = 'text/plain';
$MWJma['sdp'] = 'application/sdp';
$MWJma['sdr'] = 'application/sounder';
$MWJma['sea'] = 'application/sea';
$MWJma['sea'] = 'application/x-sea';
$MWJma['set'] = 'application/set';
$MWJma['sgm'] = 'text/sgml';
$MWJma['sgml'] = 'text/sgml';
$MWJma['sh'] = 'application/x-sh';
$MWJma['shar'] = 'application/x-shar';
$MWJma['shtml'] = 'text/html';
$MWJma['sid'] = 'audio/x-psid';
$MWJma['sit'] = 'application/x-stuffit';
$MWJma['skd'] = 'application/x-koan';
$MWJma['skm'] = 'application/x-koan';
$MWJma['skp'] = 'application/x-koan';
$MWJma['skt'] = 'application/x-koan';
$MWJma['sl'] = 'application/x-seelogo';
$MWJma['smi'] = 'application/smil';
$MWJma['smil'] = 'application/smil';
$MWJma['snd'] = 'audio/basic';
$MWJma['sol'] = 'application/solids';
$MWJma['spc'] = 'text/x-speech';
$MWJma['spl'] = 'application/futuresplash';
$MWJma['spr'] = 'application/x-sprite';
$MWJma['sprite'] = 'application/x-sprite';
$MWJma['src'] = 'application/x-wais-source';
$MWJma['ssi'] = 'text/x-server-parsed-html';
$MWJma['ssm'] = 'application/streamingmedia';
$MWJma['sst'] = 'application/vnd.ms-pki.certstore';
$MWJma['step'] = 'application/step';
$MWJma['stl'] = 'application/sla';
$MWJma['stp'] = 'application/step';
$MWJma['sv4cpio'] = 'application/x-sv4cpio';
$MWJma['sv4crc'] = 'application/x-sv4crc';
$MWJma['svf'] = 'image/vnd.dwg';
$MWJma['svr'] = 'application/x-world';
$MWJma['swf'] = 'application/x-shockwave-flash';
$MWJma['t'] = 'application/x-troff';
$MWJma['talk'] = 'text/x-speech';
$MWJma['tar'] = 'application/x-tar';
$MWJma['tbk'] = 'application/toolbook';
$MWJma['tcl'] = 'application/x-tcl';
$MWJma['tcsh'] = 'text/x-script.tcsh';
$MWJma['tex'] = 'application/x-tex';
$MWJma['texi'] = 'application/x-texinfo';
$MWJma['texinfo'] = 'application/x-texinfo';
$MWJma['text'] = 'text/plain';
$MWJma['tgz'] = 'application/x-compressed';
$MWJma['tif'] = 'image/tiff';
$MWJma['tiff'] = 'image/tiff';
$MWJma['tr'] = 'application/x-troff';
$MWJma['tsi'] = 'audio/tsp-audio';
$MWJma['tsp'] = 'audio/tsplayer';
$MWJma['tsv'] = 'text/tab-separated-values';
$MWJma['turbot'] = 'image/florian';
$MWJma['txt'] = 'text/plain';
$MWJma['uil'] = 'text/x-uil';
$MWJma['uni'] = 'text/uri-list';
$MWJma['unis'] = 'text/uri-list';
$MWJma['unv'] = 'application/i-deas';
$MWJma['uri'] = 'text/uri-list';
$MWJma['uris'] = 'text/uri-list';
$MWJma['ustar'] = 'application/x-ustar';
$MWJma['uu'] = 'application/octet-stream';
$MWJma['uue'] = 'text/x-uuencode';
$MWJma['vcd'] = 'application/x-cdlink';
$MWJma['vcs'] = 'text/x-vCalendar';
$MWJma['vda'] = 'application/vda';
$MWJma['vdo'] = 'video/vdo';
$MWJma['vew '] = 'application/groupwise';
$MWJma['viv'] = 'video/vivo';
$MWJma['vivo'] = 'video/vivo';
$MWJma['vmd'] = 'application/vocaltec-media-desc';
$MWJma['vmf'] = 'application/vocaltec-media-file';
$MWJma['voc'] = 'audio/voc';
$MWJma['vos'] = 'video/vosaic';
$MWJma['vox'] = 'audio/voxware';
$MWJma['vqe'] = 'audio/x-twinvq-plugin';
$MWJma['vqf'] = 'audio/x-twinvq';
$MWJma['vql'] = 'audio/x-twinvq-plugin';
$MWJma['vrml'] = 'application/x-vrml';
$MWJma['vrt'] = 'x-world/x-vrt';
$MWJma['vsd'] = 'application/x-visio';
$MWJma['vst'] = 'application/x-visio';
$MWJma['vsw'] = 'application/x-visio';
$MWJma['w60'] = 'application/wordperfect6.0';
$MWJma['w61'] = 'application/wordperfect6.1';
$MWJma['w6w'] = 'application/msword';
$MWJma['wav'] = 'audio/wav';
$MWJma['wb1'] = 'application/x-qpro';
$MWJma['wbmp'] = 'image/vnd.wap.wbmp';
$MWJma['web'] = 'application/vnd.xara';
$MWJma['wiz'] = 'application/msword';
$MWJma['wk1'] = 'application/x-123';
$MWJma['wmf'] = 'windows/metafile';
$MWJma['wml'] = 'text/vnd.wap.wml';
$MWJma['wmlc'] = 'application/vnd.wap.wmlc';
$MWJma['wmls'] = 'text/vnd.wap.wmlscript';
$MWJma['wmlsc'] = 'application/vnd.wap.wmlscriptc';
$MWJma['word'] = 'application/msword';
$MWJma['wp'] = 'application/wordperfect';
$MWJma['wp5'] = 'application/wordperfect';
$MWJma['wp6'] = 'application/wordperfect';
$MWJma['wpd'] = 'application/wordperfect';
$MWJma['wq1'] = 'application/x-lotus';
$MWJma['wri'] = 'application/mswrite';
$MWJma['wrl'] = 'model/vrml';
$MWJma['wrz'] = 'model/vrml';
$MWJma['wsc'] = 'text/scriplet';
$MWJma['wsrc'] = 'application/x-wais-source';
$MWJma['wtk'] = 'application/x-wintalk';
$MWJma['xbm'] = 'image/xbm';
$MWJma['xdr'] = 'video/x-amt-demorun';
$MWJma['xgz'] = 'xgl/drawing';
$MWJma['xif'] = 'image/vnd.xiff';
$MWJma['xl'] = 'application/excel';
$MWJma['xla'] = 'application/excel';
$MWJma['xlb'] = 'application/excel';
$MWJma['xlc'] = 'application/excel';
$MWJma['xld'] = 'application/excel';
$MWJma['xlk'] = 'application/excel';
$MWJma['xll'] = 'application/excel';
$MWJma['xlm'] = 'application/excel';
$MWJma['xls'] = 'application/excel';
$MWJma['xlt'] = 'application/excel';
$MWJma['xlv'] = 'application/excel';
$MWJma['xlw'] = 'application/excel';
$MWJma['xlw'] = 'application/x-excel';
$MWJma['xm'] = 'audio/xm';
$MWJma['xml'] = 'text/xml';
$MWJma['xmz'] = 'xgl/movie';
$MWJma['xpix'] = 'application/x-vnd.ls-xpix';
$MWJma['xpm'] = 'image/xpm';
$MWJma['x-png'] = 'image/png';
$MWJma['xsr'] = 'video/x-amt-showrun';
$MWJma['xwd'] = 'image/x-xwd';
$MWJma['xyz'] = 'chemical/x-pdb';
$MWJma['z'] = 'application/x-compress';
$MWJma['zip'] = 'application/zip';
$MWJma['zoo'] = 'application/octet-stream';
$MWJma['zsh'] = 'text/x-script.zsh';
function ext2mime( $fileName = '' ) {
global $MWJma; if( !is_string( $fileName ) ) { $fileName = ''; }
$fileName = preg_replace( "/.*([^.\w-][\w-]*|\.([\w-]*))$/", "$2", strtolower( '/' . $fileName ) );
if( !$fileName || !$MWJma[$fileName] ) { return 'application/octet-stream'; } else { return $MWJma[$fileName]; }
}
?>