1: <?php
2:
3: $mime_types = array(
4: '3dm'=>'x-world/x-3dmf',
5: '3dmf'=>'x-world/x-3dmf',
6: 'a'=>'application/octet-stream',
7: 'aab'=>'application/x-authorware-bin',
8: 'aam'=>'application/x-authorware-map',
9: 'aas'=>'application/x-authorware-seg',
10: 'abc'=>'text/vnd.abc',
11: 'acgi'=>'text/html',
12: 'afl'=>'video/animaflex',
13: 'ai'=>'application/postscript',
14: 'aif'=>'audio/aiff',
15: 'aif'=>'audio/x-aiff',
16: 'aifc'=>'audio/aiff',
17: 'aifc'=>'audio/x-aiff',
18: 'aiff'=>'audio/aiff',
19: 'aim'=>'application/x-aim',
20: 'aip'=>'text/x-audiosoft-intra',
21: 'ani'=>'application/x-navi-animation',
22: 'aos'=>'application/x-nokia-9000-communicator-add-on-software',
23: 'aps'=>'application/mime',
24: 'arc'=>'application/octet-stream',
25: 'arj'=>'application/octet-stream',
26: 'art'=>'image/x-jg',
27: 'asf'=>'video/x-ms-asf',
28: 'asm'=>'text/x-asm',
29: 'asp'=>'text/asp',
30: 'asx'=>'video/x-ms-asf',
31: 'au'=>'audio/basic',
32: 'avi'=>'video/avi',
33: 'avs'=>'video/avs-video',
34: 'bcpio'=>'application/x-bcpio',
35: 'bin'=>'application/octet-stream',
36: 'bm'=>'image/bmp',
37: 'bmp'=>'image/bmp',
38: 'boo'=>'application/book',
39: 'book'=>'application/book',
40: 'boz'=>'application/x-bzip2',
41: 'bsh'=>'application/x-bsh',
42: 'bz'=>'application/x-bzip',
43: 'bz2'=>'application/x-bzip2',
44: 'c'=>'text/plain',
45: 'c++'=>'text/plain',
46: 'cat'=>'application/vnd.ms-pki.seccat',
47: 'cc'=>'text/plain',
48: 'ccad'=>'application/clariscad',
49: 'cco'=>'application/x-cocoa',
50: 'cdf'=>'application/cdf',
51: 'cdf'=>'application/x-cdf',
52: 'cer'=>'application/x-x509-ca-cert',
53: 'cha'=>'application/x-chat',
54: 'chat'=>'application/x-chat',
55: 'class'=>'application/java',
56: 'com'=>'text/plain',
57: 'conf'=>'text/plain',
58: 'cpio'=>'application/x-cpio',
59: 'cpp'=>'text/x-c',
60: 'cpt'=>'application/x-cpt',
61: 'crl'=>'application/pkcs-crl',
62: 'crt'=>'application/pkix-cert',
63: 'csh'=>'text/x-script.csh',
64: 'css'=>'text/css',
65: 'cxx'=>'text/plain',
66: 'dcr'=>'application/x-director',
67: 'deepv'=>'application/x-deepv',
68: 'def'=>'text/plain',
69: 'dif'=>'video/x-dv',
70: 'dir'=>'application/x-director',
71: 'dl'=>'video/dl',
72: 'doc'=>'application/msword',
73: 'dot'=>'application/msword',
74: 'dp'=>'application/commonground',
75: 'drw'=>'application/drafting',
76: 'dump'=>'application/octet-stream',
77: 'dv'=>'video/x-dv',
78: 'dvi'=>'application/x-dvi',
79: 'dwf'=>'model/vnd.dwf',
80: 'dwg'=>'image/x-dwg',
81: 'dxf'=>'image/x-dwg',
82: 'dxr'=>'application/x-director',
83: 'el'=>'text/x-script.elisp',
84: 'elc'=>'application/x-elc',
85: 'env'=>'application/x-envoy',
86: 'eps'=>'application/postscript',
87: 'es'=>'application/x-esrehber',
88: 'etx'=>'text/x-setext',
89: 'evy'=>'application/envoy',
90: 'exe'=>'application/octet-stream',
91: 'f'=>'text/plain',
92: 'f77'=>'text/x-fortran',
93: 'f90'=>'text/plain',
94: 'fdf'=>'application/vnd.fdf',
95: 'fif'=>'image/fif',
96: 'fli'=>'video/fli',
97: 'flo'=>'image/florian',
98: 'flx'=>'text/vnd.fmi.flexstor',
99: 'fmf'=>'video/x-atomic3d-feature',
100: 'for'=>'text/plain',
101: 'fpx'=>'image/vnd.fpx',
102: 'frl'=>'application/freeloader',
103: 'flv'=>'video/x-flv',
104: 'fla'=>'audio/x-flv',
105: 'funk'=>'audio/make',
106: 'g'=>'text/plain',
107: 'g3'=>'image/g3fax',
108: 'gif'=>'image/gif',
109: 'gl'=>'video/gl',
110: 'gsd'=>'audio/x-gsm',
111: 'gsm'=>'audio/x-gsm',
112: 'gsp'=>'application/x-gsp',
113: 'gss'=>'application/x-gss',
114: 'gtar'=>'application/x-gtar',
115: 'gz'=>'application/x-compressed',
116: 'gzip'=>'multipart/x-gzip',
117: 'h'=>'text/plain',
118: 'hdf'=>'application/x-hdf',
119: 'help'=>'application/x-helpfile',
120: 'hgl'=>'application/vnd.hp-hpgl',
121: 'hh'=>'text/plain',
122: 'hlb'=>'text/x-script',
123: 'hlp'=>'application/hlp',
124: 'hpg'=>'application/vnd.hp-hpgl',
125: 'hpgl'=>'application/vnd.hp-hpgl',
126: 'hqx'=>'application/binhex',
127: 'hta'=>'application/hta',
128: 'htc'=>'text/x-component',
129: 'htm'=>'text/html',
130: 'html'=>'text/html',
131: 'htmls'=>'text/html',
132: 'htt'=>'text/webviewhtml',
133: 'htx'=>'text/html',
134: 'ice'=>'x-conference/x-cooltalk',
135: 'ico'=>'image/x-icon',
136: 'idc'=>'text/plain',
137: 'ief'=>'image/ief',
138: 'iefs'=>'image/ief',
139: 'iges'=>'model/iges',
140: 'igs'=>'model/iges',
141: 'ima'=>'application/x-ima',
142: 'imap'=>'application/x-httpd-imap',
143: 'inf'=>'application/inf',
144: 'ins'=>'application/x-internett-signup',
145: 'ip'=>'application/x-ip2',
146: 'isu'=>'video/x-isvideo',
147: 'it'=>'audio/it',
148: 'iv'=>'application/x-inventor',
149: 'ivr'=>'i-world/i-vrml',
150: 'jam'=>'audio/x-jam',
151: 'jav'=>'text/plain',
152: 'jcm'=>'application/x-java-commerce',
153: 'jfif'=>'image/jpeg',
154: 'jpe'=>'image/jpeg',
155: 'jpeg'=>'image/jpeg',
156: 'jpg'=>'image/jpeg',
157: 'js'=>'application/x-javascript',
158: 'jut'=>'image/jutvision',
159: 'kar'=>'audio/midi',
160: 'kar'=>'music/x-karaoke',
161: 'ksh'=>'text/x-script.ksh',
162: 'la'=>'audio/nspaudio',
163: 'la'=>'audio/x-nspaudio',
164: 'lam'=>'audio/x-liveaudio',
165: 'latex'=>'application/x-latex',
166: 'lha'=>'application/lha',
167: 'lhx'=>'application/octet-stream',
168: 'list'=>'text/plain',
169: 'lma'=>'audio/nspaudio',
170: 'log'=>'text/plain',
171: 'lsp'=>'text/x-script.lisp',
172: 'lst'=>'text/plain',
173: 'lsx'=>'text/x-la-asf',
174: 'lzx'=>'application/lzx',
175: 'm'=>'text/plain',
176: 'm'=>'text/x-m',
177: 'm1v'=>'video/mpeg',
178: 'm2a'=>'audio/mpeg',
179: 'm2v'=>'video/mpeg',
180: 'm4v'=>'video/mp4',
181: 'm4a'=>'audio/mp4',
182: 'm3u'=>'audio/x-mpequrl',
183: 'man'=>'application/x-troff-man',
184: 'map'=>'application/x-navimap',
185: 'mar'=>'text/plain',
186: 'mbd'=>'application/mbedlet',
187: 'mc$'=>'application/x-magic-cap-package-1.0',
188: 'mcd'=>'application/mcad',
189: 'mcf'=>'text/mcf',
190: 'mcp'=>'application/netmc',
191: 'me'=>'application/x-troff-me',
192: 'mht'=>'message/rfc822',
193: 'mhtml'=>'message/rfc822',
194: 'mid'=>'audio/midi',
195: 'midi'=>'audio/midi',
196: 'mif'=>'application/x-mif',
197: 'mime'=>'message/rfc822',
198: 'mjf'=>'audio/x-vnd.audioexplosion.mjuicemediafile',
199: 'mjpg'=>'video/x-motion-jpeg',
200: 'mm'=>'application/base64',
201: 'mm'=>'application/x-meme',
202: 'mme'=>'application/base64',
203: 'mod'=>'audio/mod',
204: 'mod'=>'audio/x-mod',
205: 'moov'=>'video/quicktime',
206: 'mov'=>'video/quicktime',
207: 'movie'=>'video/x-sgi-movie',
208: 'mp2'=>'audio/mpeg',
209: 'mp3'=>'audio/mpeg',
210: 'mp4'=>'video/mp4',
211: 'mpa'=>'audio/mpeg',
212: 'mpc'=>'application/x-project',
213: 'mpe'=>'video/mpeg',
214: 'mpeg'=>'video/mpeg',
215: 'mpg'=>'audio/mpeg',
216: 'mpga'=>'audio/mpeg',
217: 'mpp'=>'application/vnd.ms-project',
218: 'mpt'=>'application/x-project',
219: 'mpv'=>'application/x-project',
220: 'mpx'=>'application/x-project',
221: 'mrc'=>'application/marc',
222: 'ms'=>'application/x-troff-ms',
223: 'mv'=>'video/x-sgi-movie',
224: 'my'=>'audio/make',
225: 'mzz'=>'application/x-vnd.audioexplosion.mzz',
226: 'nap'=>'image/naplps',
227: 'naplps'=>'image/naplps',
228: 'nc'=>'application/x-netcdf',
229: 'ncm'=>'application/vnd.nokia.configuration-message',
230: 'nif'=>'image/x-niff',
231: 'niff'=>'image/x-niff',
232: 'nix'=>'application/x-mix-transfer',
233: 'nsc'=>'application/x-conference',
234: 'nvd'=>'application/x-navidoc',
235: 'o'=>'application/octet-stream',
236: 'oda'=>'application/oda',
237: 'ogg' => 'video/ogg',
238: 'ogv' => 'video/ogg',
239: 'oga' => 'audio/ogg',
240: 'omc'=>'application/x-omc',
241: 'omcd'=>'application/x-omcdatamaker',
242: 'omcr'=>'application/x-omcregerator',
243: 'p'=>'text/x-pascal',
244: 'p10'=>'application/pkcs10',
245: 'p12'=>'application/pkcs-12',
246: 'p7a'=>'application/x-pkcs7-signature',
247: 'p7c'=>'application/pkcs7-mime',
248: 'p7m'=>'application/pkcs7-mime',
249: 'p7r'=>'application/x-pkcs7-certreqresp',
250: 'p7s'=>'application/pkcs7-signature',
251: 'part'=>'application/pro_eng',
252: 'pas'=>'text/pascal',
253: 'pbm'=>'image/x-portable-bitmap',
254: 'pcl'=>'application/x-pcl',
255: 'pct'=>'image/x-pict',
256: 'pcx'=>'image/x-pcx',
257: 'pdb'=>'chemical/x-pdb',
258: 'pdf'=>'application/pdf',
259: 'pfunk'=>'audio/make',
260: 'pgm'=>'image/x-portable-graymap',
261: 'pic'=>'image/pict',
262: 'pict'=>'image/pict',
263: 'pkg'=>'application/x-newton-compatible-pkg',
264: 'pko'=>'application/vnd.ms-pki.pko',
265: 'pl'=>'text/plain',
266: 'plx'=>'application/x-pixclscript',
267: 'pm'=>'image/x-xpixmap',
268: 'pm4'=>'application/x-pagemaker',
269: 'pm5'=>'application/x-pagemaker',
270: 'png'=>'image/png',
271: 'pnm'=>'application/x-portable-anymap',
272: 'pnm'=>'image/x-portable-anymap',
273: 'pot'=>'application/mspowerpoint',
274: 'pov'=>'model/x-pov',
275: 'ppa'=>'application/vnd.ms-powerpoint',
276: 'ppm'=>'image/x-portable-pixmap',
277: 'pps'=>'application/mspowerpoint',
278: 'ppt'=>'application/powerpoint',
279: 'ppz'=>'application/mspowerpoint',
280: 'pre'=>'application/x-freelance',
281: 'prt'=>'application/pro_eng',
282: 'ps'=>'application/postscript',
283: 'psd'=>'application/octet-stream',
284: 'pvu'=>'paleovu/x-pv',
285: 'pwz'=>'application/vnd.ms-powerpoint',
286: 'py'=>'text/x-script.phyton',
287: 'pyc'=>'applicaiton/x-bytecode.python',
288: 'qcp'=>'audio/vnd.qcelp',
289: 'qd3'=>'x-world/x-3dmf',
290: 'qd3d'=>'x-world/x-3dmf',
291: 'qif'=>'image/x-quicktime',
292: 'qt'=>'video/quicktime',
293: 'qtc'=>'video/x-qtc',
294: 'qti'=>'image/x-quicktime',
295: 'qtif'=>'image/x-quicktime',
296: 'ra'=>'audio/x-realaudio',
297: 'ram'=>'audio/x-pn-realaudio',
298: 'ras'=>'image/cmu-raster',
299: 'rast'=>'image/cmu-raster',
300: 'rexx'=>'text/x-script.rexx',
301: 'rf'=>'image/vnd.rn-realflash',
302: 'rgb'=>'image/x-rgb',
303: 'rm'=>'audio/x-pn-realaudio',
304: 'rmi'=>'audio/mid',
305: 'rmm'=>'audio/x-pn-realaudio',
306: 'rmp'=>'audio/x-pn-realaudio',
307: 'rng'=>'application/ringing-tones',
308: 'rnx'=>'application/vnd.rn-realplayer',
309: 'roff'=>'application/x-troff',
310: 'rp'=>'image/vnd.rn-realpix',
311: 'rpm'=>'audio/x-pn-realaudio-plugin',
312: 'rt'=>'text/richtext',
313: 'rtf'=>'application/rtf',
314: 'rtf'=>'text/richtext',
315: 'rtx'=>'text/richtext',
316: 'rv'=>'video/vnd.rn-realvideo',
317: 's'=>'text/x-asm',
318: 's3m'=>'audio/s3m',
319: 'saveme'=>'application/octet-stream',
320: 'sbk'=>'application/x-tbook',
321: 'scm'=>'video/x-scm',
322: 'sdml'=>'text/plain',
323: 'sdp'=>'application/sdp',
324: 'sdr'=>'application/sounder',
325: 'sea'=>'application/sea',
326: 'set'=>'application/set',
327: 'sgm'=>'text/sgml',
328: 'sgml'=>'text/sgml',
329: 'sh'=>'text/x-script.sh',
330: 'shar'=>'application/x-bsh',
331: 'shtml'=>'text/html',
332: 'sid'=>'audio/x-psid',
333: 'sit'=>'application/x-stuffit',
334: 'skd'=>'application/x-koan',
335: 'skm'=>'application/x-koan',
336: 'skp'=>'application/x-koan',
337: 'skt'=>'application/x-koan',
338: 'sl'=>'application/x-seelogo',
339: 'smi'=>'application/smil',
340: 'smil'=>'application/smil',
341: 'snd'=>'audio/basic',
342: 'sol'=>'application/solids',
343: 'spc'=>'text/x-speech',
344: 'spl'=>'application/futuresplash',
345: 'spr'=>'application/x-sprite',
346: 'sprite'=>'application/x-sprite',
347: 'src'=>'application/x-wais-source',
348: 'ssi'=>'text/x-server-parsed-html',
349: 'ssm'=>'application/streamingmedia',
350: 'sst'=>'application/vnd.ms-pki.certstore',
351: 'step'=>'application/step',
352: 'stl'=>'application/sla',
353: 'stp'=>'application/step',
354: 'sv4cpio'=>'application/x-sv4cpio',
355: 'sv4crc'=>'application/x-sv4crc',
356: 'svf'=>'image/vnd.dwg',
357: 'svf'=>'image/x-dwg',
358: 'swf'=>'application/x-shockwave-flash',
359: 't'=>'application/x-troff',
360: 'talk'=>'text/x-speech',
361: 'tar'=>'application/x-tar',
362: 'tbk'=>'application/toolbook',
363: 'tcl'=>'text/x-script.tcl',
364: 'tcsh'=>'text/x-script.tcsh',
365: 'tex'=>'application/x-tex',
366: 'texi'=>'application/x-texinfo',
367: 'texinfo'=>'application/x-texinfo',
368: 'text'=>'text/plain',
369: 'tgz'=>'application/gnutar',
370: 'tif'=>'image/tiff',
371: 'tr'=>'application/x-troff',
372: 'tsi'=>'audio/tsp-audio',
373: 'tsp'=>'audio/tsplayer',
374: 'tsv'=>'text/tab-separated-values',
375: 'turbot'=>'image/florian',
376: 'txt'=>'text/plain',
377: 'uil'=>'text/x-uil',
378: 'uni'=>'text/uri-list',
379: 'unis'=>'text/uri-list',
380: 'unv'=>'application/i-deas',
381: 'uri'=>'text/uri-list',
382: 'uris'=>'text/uri-list',
383: 'ustar'=>'multipart/x-ustar',
384: 'uu'=>'application/octet-stream',
385: 'uue'=>'text/x-uuencode',
386: 'vcd'=>'application/x-cdlink',
387: 'vcs'=>'text/x-vcalendar',
388: 'vda'=>'application/vda',
389: 'vdo'=>'video/vdo',
390: 'vew'=>'application/groupwise',
391: 'viv'=>'video/vivo',
392: 'vivo'=>'video/vivo',
393: 'vmd'=>'application/vocaltec-media-desc',
394: 'vmf'=>'application/vocaltec-media-file',
395: 'voc'=>'audio/voc',
396: 'vqe'=>'audio/x-twinvq-plugin',
397: 'vqf'=>'audio/x-twinvq',
398: 'vql'=>'audio/x-twinvq-plugin',
399: 'vrml'=>'model/vrml',
400: 'vrt'=>'x-world/x-vrt',
401: 'vsd'=>'application/x-visio',
402: 'vst'=>'application/x-visio',
403: 'vsw'=>'application/x-visio',
404: 'w60'=>'application/wordperfect6.0',
405: 'w61'=>'application/wordperfect6.1',
406: 'w6w'=>'application/msword',
407: 'wav'=>'audio/wav',
408: 'wb1'=>'application/x-qpro',
409: 'wbmp'=>'image/vnd.wap.wbmp',
410: 'web'=>'application/vnd.xara',
411: 'webma' => 'audio/webm',
412: 'webm' => 'video/webm',
413: 'webmv' => 'video/webm',
414: 'wiz'=>'application/msword',
415: 'wk1'=>'application/x-123',
416: 'wmf'=>'windows/metafile',
417: 'wml'=>'text/vnd.wap.wml',
418: 'wmlc'=>'application/vnd.wap.wmlc',
419: 'wmls'=>'text/vnd.wap.wmlscript',
420: 'wmlsc'=>'application/vnd.wap.wmlscriptc',
421: 'word'=>'application/msword',
422: 'wp'=>'application/wordperfect',
423: 'wp5'=>'application/wordperfect',
424: 'wp6'=>'application/wordperfect',
425: 'wpd'=>'application/wordperfect',
426: 'wq1'=>'application/x-lotus',
427: 'wri'=>'application/mswrite',
428: 'wrl'=>'model/vrml',
429: 'wrz'=>'model/vrml',
430: 'wsc'=>'text/scriplet',
431: 'wsrc'=>'application/x-wais-source',
432: 'wtk'=>'application/x-wintalk',
433: 'xbm'=>'image/xbm',
434: 'xdr'=>'video/x-amt-demorun',
435: 'xgz'=>'xgl/drawing',
436: 'xif'=>'image/vnd.xiff',
437: 'xl'=>'application/excel',
438: 'xla'=>'application/excel',
439: 'xlb'=>'application/excel',
440: 'xlc'=>'application/excel',
441: 'xld'=>'application/excel',
442: 'xlk'=>'application/excel',
443: 'xll'=>'application/excel',
444: 'xlm'=>'application/excel',
445: 'xls'=>'application/excel',
446: 'xlt'=>'application/excel',
447: 'xlv'=>'application/excel',
448: 'xlw'=>'application/excel',
449: 'xm'=>'audio/xm',
450: 'xml'=>'text/xml',
451: 'xmz'=>'xgl/movie',
452: 'xpix'=>'application/x-vnd.ls-xpix',
453: 'xpm'=>'image/xpm',
454: 'x-png'=>'image/png',
455: 'xsr'=>'video/x-amt-showrun',
456: 'xwd'=>'image/x-xwd',
457: 'xyz'=>'chemical/x-pdb',
458: 'z'=>'application/x-compress',
459: 'zip'=>'multipart/x-zip',
460: 'zoo'=>'application/octet-stream',
461: 'zsh'=>'text/x-script.zsh'
462: );
463: function getMimeString($suffix) {
464: global $mime_types;
465: if (array_key_exists($suffix, $mime_types)) {
466: return $mime_types[$suffix];
467: } else {
468: return 'application/octet-stream';
469: }
470: }
471: ?>
472: