]> git.mxchange.org Git - friendica.git/blob - include/attach.php
Merge pull request #2486 from rabuzarus/2704_xml
[friendica.git] / include / attach.php
1 <?php
2
3
4 function z_mime_content_type($filename) {
5
6         $mime_types = array(
7
8                 /*'txt' => 'text/plain',
9                 'htm' => 'text/html',
10                 'html' => 'text/html',
11                 'php' => 'text/html',
12                 'css' => 'text/css',
13                 'js' => 'application/javascript',
14                 'json' => 'application/json',
15                 'xml' => 'application/xml',
16                 'swf' => 'application/x-shockwave-flash',
17                 'flv' => 'video/x-flv',
18
19                 // images
20                 'png' => 'image/png',
21                 'jpe' => 'image/jpeg',
22                 'jpeg' => 'image/jpeg',
23                 'jpg' => 'image/jpeg',
24                 'gif' => 'image/gif',
25                 'bmp' => 'image/bmp',
26                 'ico' => 'image/vnd.microsoft.icon',
27                 'tiff' => 'image/tiff',
28                 'tif' => 'image/tiff',
29                 'svg' => 'image/svg+xml',
30                 'svgz' => 'image/svg+xml',
31
32                 // archives
33                 'zip' => 'application/zip',
34                 'rar' => 'application/x-rar-compressed',
35                 'exe' => 'application/x-msdownload',
36                 'msi' => 'application/x-msdownload',
37                 'cab' => 'application/vnd.ms-cab-compressed',
38
39                 // audio/video
40                 'mp3' => 'audio/mpeg',
41                 'wav' => 'audio/wav',
42                 'qt' => 'video/quicktime',
43                 'mov' => 'video/quicktime',
44                 'ogg' => 'application/ogg',
45                 'mp4' => 'video/mp4',
46                 'avi' => 'video/x-msvideo',
47                 'wmv' => 'video/x-ms-wmv',
48                 'wma' => 'audio/x-ms-wma',
49
50                 // adobe
51                 'pdf' => 'application/pdf',
52                 'psd' => 'image/vnd.adobe.photoshop',
53                 'ai' => 'application/postscript',
54                 'eps' => 'application/postscript',
55                 'ps' => 'application/postscript',
56
57                 // ms office
58                 'doc' => 'application/msword',
59                 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
60                 'rtf' => 'application/rtf',
61                 'xls' => 'application/vnd.ms-excel',
62                 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
63                 'ppt' => 'application/vnd.ms-powerpoint',
64                 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
65
66
67                 // open office
68                 'odt' => 'application/vnd.oasis.opendocument.text',
69                 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',*/
70
71                 // Assembled from the original Friendica list and
72                 // lists from http://www.freeformatter.com/mime-types-list.html
73                 // and http://www.webmaster-toolkit.com/mime-types.shtml
74                 '123' => 'application/vnd.lotus-1-2-3',
75                 '3dm' => 'x-world/x-3dmf',
76                 '3dmf' => 'x-world/x-3dmf',
77                 '3dml' => 'text/vnd.in3d.3dml',
78                 '3g2' => 'video/3gpp2',
79                 '3gp' => 'video/3gpp',
80                 '7z' => 'application/x-7z-compressed',
81                 'a' => 'application/octet-stream',
82                 'aab' => 'application/x-authorware-bin',
83                 'aac' => 'audio/x-aac',
84                 'aam' => 'application/x-authorware-map',
85                 'aas' => 'application/x-authorware-seg',
86                 'abc' => 'text/vnd.abc',
87                 'abw' => 'application/x-abiword',
88                 'ac' => 'application/pkix-attr-cert',
89                 'acc' => 'application/vnd.americandynamics.acc',
90                 'ace' => 'application/x-ace-compressed',
91                 'acgi' => 'text/html',
92                 'acu' => 'application/vnd.acucobol',
93                 'adp' => 'audio/adpcm',
94                 'aep' => 'application/vnd.audiograph',
95                 'afl' => 'video/animaflex',
96                 'afp' => 'application/vnd.ibm.modcap',
97                 'ahead' => 'application/vnd.ahead.space',
98                 'ai' => 'application/postscript',
99                 'aif' => 'audio/x-aiff',
100                 'aifc' => 'audio/x-aiff',
101                 'aiff' => 'audio/x-aiff',
102                 'aim' => 'application/x-aim',
103                 'aip' => 'text/x-audiosoft-intra',
104                 'air' => 'application/vnd.adobe.air-application-installer-package+zip',
105                 'ait' => 'application/vnd.dvb.ait',
106                 'ami' => 'application/vnd.amiga.ami',
107                 'ani' => 'application/x-navi-animation',
108                 'aos' => 'application/x-nokia-9000-communicator-add-on-software',
109                 'apk' => 'application/vnd.android.package-archive',
110                 'application' => 'application/x-ms-application',
111                 'apr' => 'application/vnd.lotus-approach',
112                 'aps' => 'application/mime',
113                 'arc' => 'application/octet-stream',
114                 'arj' => 'application/octet-stream',
115                 'art' => 'image/x-jg',
116                 'asf' => 'video/x-ms-asf',
117                 'asm' => 'text/x-asm',
118                 'aso' => 'application/vnd.accpac.simply.aso',
119                 'asp' => 'text/asp',
120                 'asx' => 'video/x-ms-asf-plugin',
121                 'atc' => 'application/vnd.acucorp',
122                 'atom' => 'application/atom+xml',
123                 'atomcat' => 'application/atomcat+xml',
124                 'atomsvc' => 'application/atomsvc+xml',
125                 'atx' => 'application/vnd.antix.game-component',
126                 'au' => 'audio/basic',
127                 'avi' => 'video/x-msvideo',
128                 'avs' => 'video/avs-video',
129                 'aw' => 'application/applixware',
130                 'azf' => 'application/vnd.airzip.filesecure.azf',
131                 'azs' => 'application/vnd.airzip.filesecure.azs',
132                 'azw' => 'application/vnd.amazon.ebook',
133                 'bcpio' => 'application/x-bcpio',
134                 'bdf' => 'application/x-font-bdf',
135                 'bdm' => 'application/vnd.syncml.dm+wbxml',
136                 'bed' => 'application/vnd.realvnc.bed',
137                 'bh2' => 'application/vnd.fujitsu.oasysprs',
138                 'bin' => 'application/octet-stream',
139                 'bm' => 'image/bmp',
140                 'bmi' => 'application/vnd.bmi',
141                 'bmp' => 'image/bmp',
142                 'boo' => 'application/book',
143                 'book' => 'application/book',
144                 'box' => 'application/vnd.previewsystems.box',
145                 'boz' => 'application/x-bzip2',
146                 'bsh' => 'application/x-bsh',
147                 'btif' => 'image/prs.btif',
148                 'bz' => 'application/x-bzip',
149                 'bz2' => 'application/x-bzip2',
150                 'c' => 'text/x-c',
151                 'c++' => 'text/plain',
152                 'c11amc' => 'application/vnd.cluetrust.cartomobile-config',
153                 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',
154                 'c4g' => 'application/vnd.clonk.c4group',
155                 'cab' => 'application/vnd.ms-cab-compressed',
156                 'car' => 'application/vnd.curl.car',
157                 'cat' => 'application/vnd.ms-pki.seccat',
158                 'cc' => 'text/x-c',
159                 'ccad' => 'application/clariscad',
160                 'cco' => 'application/x-cocoa',
161                 'ccxml' => 'application/ccxml+xml,',
162                 'cdbcmsg' => 'application/vnd.contact.cmsg',
163                 'cdf' => 'application/x-netcdf',
164                 'cdkey' => 'application/vnd.mediastation.cdkey',
165                 'cdmia' => 'application/cdmi-capability',
166                 'cdmic' => 'application/cdmi-container',
167                 'cdmid' => 'application/cdmi-domain',
168                 'cdmio' => 'application/cdmi-object',
169                 'cdmiq' => 'application/cdmi-queue',
170                 'cdx' => 'chemical/x-cdx',
171                 'cdxml' => 'application/vnd.chemdraw+xml',
172                 'cdy' => 'application/vnd.cinderella',
173                 'cer' => 'application/pkix-cert',
174                 'cgm' => 'image/cgm',
175                 'cha' => 'application/x-chat',
176                 'chat' => 'application/x-chat',
177                 'chm' => 'application/vnd.ms-htmlhelp',
178                 'chrt' => 'application/vnd.kde.kchart',
179                 'cif' => 'chemical/x-cif',
180                 'cii' => 'application/vnd.anser-web-certificate-issue-initiation',
181                 'cil' => 'application/vnd.ms-artgalry',
182                 'cla' => 'application/vnd.claymore',
183                 'class' => 'application/java-vm',
184                 'clkk' => 'application/vnd.crick.clicker.keyboard',
185                 'clkp' => 'application/vnd.crick.clicker.palette',
186                 'clkt' => 'application/vnd.crick.clicker.template',
187                 'clkw' => 'application/vnd.crick.clicker.wordbank',
188                 'clkx' => 'application/vnd.crick.clicker',
189                 'clp' => 'application/x-msclip',
190                 'cmc' => 'application/vnd.cosmocaller',
191                 'cmdf' => 'chemical/x-cmdf',
192                 'cml' => 'chemical/x-cml',
193                 'cmp' => 'application/vnd.yellowriver-custom-menu',
194                 'cmx' => 'image/x-cmx',
195                 'cod' => 'application/vnd.rim.cod',
196                 'com' => 'text/plain',
197                 'conf' => 'text/plain',
198                 'cpio' => 'application/x-cpio',
199                 'cpp' => 'text/x-c',
200                 'cpt' => 'application/mac-compactpro',
201                 'crd' => 'application/x-mscardfile',
202                 'crl' => 'application/pkix-crl',
203                 'crt' => 'application/x-x509-user-cert',
204                 'cryptonote' => 'application/vnd.rig.cryptonote',
205                 'csh' => 'application/x-csh',
206                 'csml' => 'chemical/x-csml',
207                 'csp' => 'application/vnd.commonspace',
208                 'css' => 'text/css',
209                 'csv' => 'text/csv',
210                 'cu' => 'application/cu-seeme',
211                 'curl' => 'text/vnd.curl',
212                 'cww' => 'application/prs.cww',
213                 'cxx' => 'text/plain',
214                 'dae' => 'model/vnd.collada+xml',
215                 'daf' => 'application/vnd.mobius.daf',
216                 'davmount' => 'application/davmount+xml',
217                 'dcr' => 'application/x-director',
218                 'dcurl' => 'text/vnd.curl.dcurl',
219                 'dd2' => 'application/vnd.oma.dd2+xml',
220                 'ddd' => 'application/vnd.fujixerox.ddd',
221                 'deb' => 'application/x-debian-package',
222                 'deepv' => 'application/x-deepv',
223                 'def' => 'text/plain',
224                 'der' => 'application/x-x509-ca-cert',
225                 'dfac' => 'application/vnd.dreamfactory',
226                 'dif' => 'video/x-dv',
227                 'dir' => 'application/x-director',
228                 'dis' => 'application/vnd.mobius.dis',
229                 'djvu' => 'image/vnd.djvu',
230                 'dl' => 'video/x-dl',
231                 'dna' => 'application/vnd.dna',
232                 'doc' => 'application/msword',
233                 'docm' => 'application/vnd.ms-word.document.macroenabled.12',
234                 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
235                 'dot' => 'application/msword',
236                 'dotm' => 'application/vnd.ms-word.template.macroenabled.12',
237                 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
238                 'dp' => 'application/vnd.osgi.dp',
239                 'dpg' => 'application/vnd.dpgraph',
240                 'dra' => 'audio/vnd.dra',
241                 'drw' => 'application/drafting',
242                 'dsc' => 'text/prs.lines.tag',
243                 'dssc' => 'application/dssc+der',
244                 'dtb' => 'application/x-dtbook+xml',
245                 'dtd' => 'application/xml-dtd',
246                 'dts' => 'audio/vnd.dts',
247                 'dtshd' => 'audio/vnd.dts.hd',
248                 'dump' => 'application/octet-stream',
249                 'dv' => 'video/x-dv',
250                 'dvi' => 'application/x-dvi',
251                 'dwf' => 'model/vnd.dwf',
252                 'dwg' => 'image/vnd.dwg',
253                 'dxf' => 'image/vnd.dxf',
254                 'dxp' => 'application/vnd.spotfire.dxp',
255                 'dxr' => 'application/x-director',
256                 'ecelp4800' => 'audio/vnd.nuera.ecelp4800',
257                 'ecelp7470' => 'audio/vnd.nuera.ecelp7470',
258                 'ecelp9600' => 'audio/vnd.nuera.ecelp9600',
259                 'edm' => 'application/vnd.novadigm.edm',
260                 'edx' => 'application/vnd.novadigm.edx',
261                 'efif' => 'application/vnd.picsel',
262                 'ei6' => 'application/vnd.pg.osasli',
263                 'el' => 'text/x-script.elisp',
264                 'elc' => 'application/x-elc',
265                 'eml' => 'message/rfc822',
266                 'emma' => 'application/emma+xml',
267                 'env' => 'application/x-envoy',
268                 'eol' => 'audio/vnd.digital-winds',
269                 'eot' => 'application/vnd.ms-fontobject',
270                 'eps' => 'application/postscript',
271                 'epub' => 'application/epub+zip',
272                 'es' => 'application/ecmascript',
273                 'es3' => 'application/vnd.eszigno3+xml',
274                 'esf' => 'application/vnd.epson.esf',
275                 'etx' => 'text/x-setext',
276                 'evy' => 'application/x-envoy',
277                 'exe' => 'application/x-msdownload',
278                 'exi' => 'application/exi',
279                 'ext' => 'application/vnd.novadigm.ext',
280                 'ez2' => 'application/vnd.ezpix-album',
281                 'ez3' => 'application/vnd.ezpix-package',
282                 'f' => 'text/x-fortran',
283                 'f4v' => 'video/x-f4v',
284                 'f77' => 'text/x-fortran',
285                 'f90' => 'text/x-fortran',
286                 'fbs' => 'image/vnd.fastbidsheet',
287                 'fcs' => 'application/vnd.isac.fcs',
288                 'fdf' => 'application/vnd.fdf',
289                 'fe_launch' => 'application/vnd.denovo.fcselayout-link',
290                 'fg5' => 'application/vnd.fujitsu.oasysgp',
291                 'fh' => 'image/x-freehand',
292                 'fif' => 'image/fif',
293                 'fig' => 'application/x-xfig',
294                 'fli' => 'video/x-fli',
295                 'flo' => 'application/vnd.micrografx.flo',
296                 'flv' => 'video/x-flv',
297                 'flw' => 'application/vnd.kde.kivio',
298                 'flx' => 'text/vnd.fmi.flexstor',
299                 'fly' => 'text/vnd.fly',
300                 'fm' => 'application/vnd.framemaker',
301                 'fmf' => 'video/x-atomic3d-feature',
302                 'fnc' => 'application/vnd.frogans.fnc',
303                 'for' => 'text/x-fortran',
304                 'fpx' => 'image/vnd.fpx',
305                 'frl' => 'application/freeloader',
306                 'fsc' => 'application/vnd.fsc.weblaunch',
307                 'fst' => 'image/vnd.fst',
308                 'ftc' => 'application/vnd.fluxtime.clip',
309                 'fti' => 'application/vnd.anser-web-funds-transfer-initiation',
310                 'funk' => 'audio/make',
311                 'fvt' => 'video/vnd.fvt',
312                 'fxp' => 'application/vnd.adobe.fxp',
313                 'fzs' => 'application/vnd.fuzzysheet',
314                 'g' => 'text/plain',
315                 'g2w' => 'application/vnd.geoplan',
316                 'g3' => 'image/g3fax',
317                 'g3w' => 'application/vnd.geospace',
318                 'gac' => 'application/vnd.groove-account',
319                 'gdl' => 'model/vnd.gdl',
320                 'geo' => 'application/vnd.dynageo',
321                 'gex' => 'application/vnd.geometry-explorer',
322                 'ggb' => 'application/vnd.geogebra.file',
323                 'ggt' => 'application/vnd.geogebra.tool',
324                 'ghf' => 'application/vnd.groove-help',
325                 'gif' => 'image/gif',
326                 'gim' => 'application/vnd.groove-identity-message',
327                 'gl' => 'video/x-gl',
328                 'gmx' => 'application/vnd.gmx',
329                 'gnumeric' => 'application/x-gnumeric',
330                 'gph' => 'application/vnd.flographit',
331                 'gqf' => 'application/vnd.grafeq',
332                 'gram' => 'application/srgs',
333                 'grv' => 'application/vnd.groove-injector',
334                 'grxml' => 'application/srgs+xml',
335                 'gsd' => 'audio/x-gsm',
336                 'gsf' => 'application/x-font-ghostscript',
337                 'gsm' => 'audio/x-gsm',
338                 'gsp' => 'application/x-gsp',
339                 'gss' => 'application/x-gss',
340                 'gtar' => 'application/x-gtar',
341                 'gtm' => 'application/vnd.groove-tool-message',
342                 'gtw' => 'model/vnd.gtw',
343                 'gv' => 'text/vnd.graphviz',
344                 'gxt' => 'application/vnd.geonext',
345                 'gz' => 'application/x-gzip',
346                 'gzip' => 'multipart/x-gzip',
347                 'h' => 'text/x-h',
348                 'h261' => 'video/h261',
349                 'h263' => 'video/h263',
350                 'h264' => 'video/h264',
351                 'hal' => 'application/vnd.hal+xml',
352                 'hbci' => 'application/vnd.hbci',
353                 'hdf' => 'application/x-hdf',
354                 'help' => 'application/x-helpfile',
355                 'hgl' => 'application/vnd.hp-hpgl',
356                 'hh' => 'text/x-h',
357                 'hlb' => 'text/x-script',
358                 'hlp' => 'application/winhlp',
359                 'hpg' => 'application/vnd.hp-hpgl',
360                 'hpgl' => 'application/vnd.hp-hpgl',
361                 'hpid' => 'application/vnd.hp-hpid',
362                 'hps' => 'application/vnd.hp-hps',
363                 'hqx' => 'application/mac-binhex40',
364                 'hta' => 'application/hta',
365                 'htc' => 'text/x-component',
366                 'htke' => 'application/vnd.kenameaapp',
367                 'htm' => 'text/html',
368                 'html' => 'text/html',
369                 'htmls' => 'text/html',
370                 'htt' => 'text/webviewhtml',
371                 'htx' => 'text/html',
372                 'hvd' => 'application/vnd.yamaha.hv-dic',
373                 'hvp' => 'application/vnd.yamaha.hv-voice',
374                 'hvs' => 'application/vnd.yamaha.hv-script',
375                 'i2g' => 'application/vnd.intergeo',
376                 'icc' => 'application/vnd.iccprofile',
377                 'ice' => 'x-conference/x-cooltalk',
378                 'ico' => 'image/vnd.microsoft.icon',
379                 'ics' => 'text/calendar',
380                 'idc' => 'text/plain',
381                 'ief' => 'image/ief',
382                 'iefs' => 'image/ief',
383                 'ifm' => 'application/vnd.shana.informed.formdata',
384                 'iges' => 'model/iges',
385                 'igl' => 'application/vnd.igloader',
386                 'igm' => 'application/vnd.insors.igm',
387                 'igs' => 'model/iges',
388                 'igx' => 'application/vnd.micrografx.igx',
389                 'iif' => 'application/vnd.shana.informed.interchange',
390                 'ima' => 'application/x-ima',
391                 'imap' => 'application/x-httpd-imap',
392                 'imp' => 'application/vnd.accpac.simply.imp',
393                 'ims' => 'application/vnd.ms-ims',
394                 'inf' => 'application/inf',
395                 'ins' => 'application/x-internett-signup',
396                 'ip' => 'application/x-ip2',
397                 'ipfix' => 'application/ipfix',
398                 'ipk' => 'application/vnd.shana.informed.package',
399                 'irm' => 'application/vnd.ibm.rights-management',
400                 'irp' => 'application/vnd.irepository.package+xml',
401                 'isu' => 'video/x-isvideo',
402                 'it' => 'audio/it',
403                 'itp' => 'application/vnd.shana.informed.formtemplate',
404                 'iv' => 'application/x-inventor',
405                 'ivp' => 'application/vnd.immervision-ivp',
406                 'ivr' => 'i-world/i-vrml',
407                 'ivu' => 'application/vnd.immervision-ivu',
408                 'ivy' => 'application/x-livescreen',
409                 'jad' => 'text/vnd.sun.j2me.app-descriptor',
410                 'jam' => 'application/vnd.jam',
411                 'jar' => 'application/java-archive',
412                 'jav' => 'text/x-java-source',
413                 'java' => 'text/x-java-source,java',
414                 'jcm' => 'application/x-java-commerce',
415                 'jfif' => 'image/pjpeg',
416                 'jfif-tbnl' => 'image/jpeg',
417                 'jisp' => 'application/vnd.jisp',
418                 'jlt' => 'application/vnd.hp-jlyt',
419                 'jnlp' => 'application/x-java-jnlp-file',
420                 'joda' => 'application/vnd.joost.joda-archive',
421                 'jpe' => 'image/jpeg',
422                 'jpeg' => 'image/jpeg',
423                 'jpg' => 'image/jpeg',
424                 'jpgv' => 'video/jpeg',
425                 'jpm' => 'video/jpm',
426                 'jps' => 'image/x-jps',
427                 'js' => 'application/javascript',
428                 'json' => 'application/json',
429                 'jut' => 'image/jutvision',
430                 'kar' => 'music/x-karaoke',
431                 'karbon' => 'application/vnd.kde.karbon',
432                 'kfo' => 'application/vnd.kde.kformula',
433                 'kia' => 'application/vnd.kidspiration',
434                 'kml' => 'application/vnd.google-earth.kml+xml',
435                 'kmz' => 'application/vnd.google-earth.kmz',
436                 'kne' => 'application/vnd.kinar',
437                 'kon' => 'application/vnd.kde.kontour',
438                 'kpr' => 'application/vnd.kde.kpresenter',
439                 'ksh' => 'text/x-script.ksh',
440                 'ksp' => 'application/vnd.kde.kspread',
441                 'ktx' => 'image/ktx',
442                 'ktz' => 'application/vnd.kahootz',
443                 'kwd' => 'application/vnd.kde.kword',
444                 'la' => 'audio/x-nspaudio',
445                 'lam' => 'audio/x-liveaudio',
446                 'lasxml' => 'application/vnd.las.las+xml',
447                 'latex' => 'application/x-latex',
448                 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop',
449                 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
450                 'les' => 'application/vnd.hhe.lesson-player',
451                 'lha' => 'application/x-lha',
452                 'lhx' => 'application/octet-stream',
453                 'link66' => 'application/vnd.route66.link66+xml',
454                 'list' => 'text/plain',
455                 'lma' => 'audio/x-nspaudio',
456                 'log' => 'text/plain',
457                 'lrm' => 'application/vnd.ms-lrm',
458                 'lsp' => 'text/x-script.lisp',
459                 'lst' => 'text/plain',
460                 'lsx' => 'text/x-la-asf',
461                 'ltf' => 'application/vnd.frogans.ltf',
462                 'ltx' => 'application/x-latex',
463                 'lvp' => 'audio/vnd.lucent.voice',
464                 'lwp' => 'application/vnd.lotus-wordpro',
465                 'lzh' => 'application/x-lzh',
466                 'lzx' => 'application/x-lzx',
467                 'm' => 'text/x-m',
468                 'm1v' => 'video/mpeg',
469                 'm21' => 'application/mp21',
470                 'm2a' => 'audio/mpeg',
471                 'm2v' => 'video/mpeg',
472                 'm3u' => 'audio/x-mpegurl',
473                 'm3u8' => 'application/vnd.apple.mpegurl',
474                 'm4v' => 'video/x-m4v',
475                 'ma' => 'application/mathematica',
476                 'mads' => 'application/mads+xml',
477                 'mag' => 'application/vnd.ecowin.chart',
478                 'man' => 'application/x-troff-man',
479                 'map' => 'application/x-navimap',
480                 'mar' => 'text/plain',
481                 'mathml' => 'application/mathml+xml',
482                 'mbd' => 'application/mbedlet',
483                 'mbk' => 'application/vnd.mobius.mbk',
484                 'mbox' => 'application/mbox',
485                 'mc$' => 'application/x-magic-cap-package-1.0',
486                 'mc1' => 'application/vnd.medcalcdata',
487                 'mcd' => 'application/vnd.mcd',
488                 'mcf' => 'text/mcf',
489                 'mcp' => 'application/netmc',
490                 'mcurl' => 'text/vnd.curl.mcurl',
491                 'mdb' => 'application/x-msaccess',
492                 'mdi' => 'image/vnd.ms-modi',
493                 'me' => 'application/x-troff-me',
494                 'meta4' => 'application/metalink4+xml',
495                 'mets' => 'application/mets+xml',
496                 'mfm' => 'application/vnd.mfmp',
497                 'mgp' => 'application/vnd.osgeo.mapguide.package',
498                 'mgz' => 'application/vnd.proteus.magazine',
499                 'mht' => 'message/rfc822',
500                 'mhtml' => 'message/rfc822',
501                 'mid' => 'audio/midi',
502                 'midi' => 'x-music/x-midi',
503                 'mif' => 'application/vnd.mif',
504                 'mime' => 'www/mime',
505                 'mj2' => 'video/mj2',
506                 'mjf' => 'audio/x-vnd.audioexplosion.mjuicemediafile',
507                 'mjpg' => 'video/x-motion-jpeg',
508                 'mlp' => 'application/vnd.dolby.mlp',
509                 'mm' => 'application/x-meme',
510                 'mmd' => 'application/vnd.chipnuts.karaoke-mmd',
511                 'mme' => 'application/base64',
512                 'mmf' => 'application/vnd.smaf',
513                 'mmr' => 'image/vnd.fujixerox.edmics-mmr',
514                 'mny' => 'application/x-msmoney',
515                 'mod' => 'audio/x-mod',
516                 'mods' => 'application/mods+xml',
517                 'moov' => 'video/quicktime',
518                 'mov' => 'video/quicktime',
519                 'movie' => 'video/x-sgi-movie',
520                 'mp2' => 'video/x-mpeq2a',
521                 'mp3' => 'audio/mpeg',
522                 'mp4' => 'video/mp4',
523                 'mp4a' => 'audio/mp4',
524                 'mpa' => 'video/mpeg',
525                 'mpc' => 'application/vnd.mophun.certificate',
526                 'mpe' => 'video/mpeg',
527                 'mpeg' => 'video/mpeg',
528                 'mpg' => 'video/mpeg',
529                 'mpga' => 'audio/mpeg',
530                 'mpkg' => 'application/vnd.apple.installer+xml',
531                 'mpm' => 'application/vnd.blueice.multipass',
532                 'mpn' => 'application/vnd.mophun.application',
533                 'mpp' => 'application/vnd.ms-project',
534                 'mpt' => 'application/x-project',
535                 'mpv' => 'application/x-project',
536                 'mpx' => 'application/x-project',
537                 'mpy' => 'application/vnd.ibm.minipay',
538                 'mqy' => 'application/vnd.mobius.mqy',
539                 'mrc' => 'application/marc',
540                 'mrcx' => 'application/marcxml+xml',
541                 'ms' => 'application/x-troff-ms',
542                 'mscml' => 'application/mediaservercontrol+xml',
543                 'mseq' => 'application/vnd.mseq',
544                 'msf' => 'application/vnd.epson.msf',
545                 'msh' => 'model/mesh',
546                 'msi' => 'application/x-msdownload',
547                 'msl' => 'application/vnd.mobius.msl',
548                 'msty' => 'application/vnd.muvee.style',
549                 'mts' => 'model/vnd.mts',
550                 'mus' => 'application/vnd.musician',
551                 'musicxml' => 'application/vnd.recordare.musicxml+xml',
552                 'mv' => 'video/x-sgi-movie',
553                 'mvb' => 'application/x-msmediaview',
554                 'mwf' => 'application/vnd.mfer',
555                 'mxf' => 'application/mxf',
556                 'mxl' => 'application/vnd.recordare.musicxml',
557                 'mxml' => 'application/xv+xml',
558                 'mxs' => 'application/vnd.triscape.mxs',
559                 'mxu' => 'video/vnd.mpegurl',
560                 'my' => 'audio/make',
561                 'mzz' => 'application/x-vnd.audioexplosion.mzz',
562                 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install',
563                 'n3' => 'text/n3',
564                 'nap' => 'image/naplps',
565                 'naplps' => 'image/naplps',
566                 'nbp' => 'application/vnd.wolfram.player',
567                 'nc' => 'application/x-netcdf',
568                 'ncm' => 'application/vnd.nokia.configuration-message',
569                 'ncx' => 'application/x-dtbncx+xml',
570                 'ngdat' => 'application/vnd.nokia.n-gage.data',
571                 'nif' => 'image/x-niff',
572                 'niff' => 'image/x-niff',
573                 'nix' => 'application/x-mix-transfer',
574                 'nlu' => 'application/vnd.neurolanguage.nlu',
575                 'nml' => 'application/vnd.enliven',
576                 'nnd' => 'application/vnd.noblenet-directory',
577                 'nns' => 'application/vnd.noblenet-sealer',
578                 'nnw' => 'application/vnd.noblenet-web',
579                 'npx' => 'image/vnd.net-fpx',
580                 'nsc' => 'application/x-conference',
581                 'nsf' => 'application/vnd.lotus-notes',
582                 'nvd' => 'application/x-navidoc',
583                 'o' => 'application/octet-stream',
584                 'oa2' => 'application/vnd.fujitsu.oasys2',
585                 'oa3' => 'application/vnd.fujitsu.oasys3',
586                 'oas' => 'application/vnd.fujitsu.oasys',
587                 'obd' => 'application/x-msbinder',
588                 'oda' => 'application/oda',
589                 'odb' => 'application/vnd.oasis.opendocument.database',
590                 'odc' => 'application/vnd.oasis.opendocument.chart',
591                 'odf' => 'application/vnd.oasis.opendocument.formula',
592                 'odft' => 'application/vnd.oasis.opendocument.formula-template',
593                 'odg' => 'application/vnd.oasis.opendocument.graphics',
594                 'odi' => 'application/vnd.oasis.opendocument.image',
595                 'odm' => 'application/vnd.oasis.opendocument.text-master',
596                 'odp' => 'application/vnd.oasis.opendocument.presentation',
597                 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
598                 'odt' => 'application/vnd.oasis.opendocument.text',
599                 'oga' => 'audio/ogg',
600                 'ogg' => 'application/ogg',
601                 'ogv' => 'video/ogg',
602                 'ogx' => 'application/ogg',
603                 'omc' => 'application/x-omc',
604                 'omcd' => 'application/x-omcdatamaker',
605                 'omcr' => 'application/x-omcregerator',
606                 'onetoc' => 'application/onenote',
607                 'opf' => 'application/oebps-package+xml',
608                 'org' => 'application/vnd.lotus-organizer',
609                 'osf' => 'application/vnd.yamaha.openscoreformat',
610                 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
611                 'otc' => 'application/vnd.oasis.opendocument.chart-template',
612                 'otf' => 'application/x-font-otf',
613                 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
614                 'oth' => 'application/vnd.oasis.opendocument.text-web',
615                 'oti' => 'application/vnd.oasis.opendocument.image-template',
616                 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
617                 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
618                 'ott' => 'application/vnd.oasis.opendocument.text-template',
619                 'oxt' => 'application/vnd.openofficeorg.extension',
620                 'p' => 'text/x-pascal',
621                 'p10' => 'application/pkcs10',
622                 'p12' => 'application/x-pkcs12',
623                 'p7a' => 'application/x-pkcs7-signature',
624                 'p7b' => 'application/x-pkcs7-certificates',
625                 'p7c' => 'application/x-pkcs7-mime',
626                 'p7m' => 'application/pkcs7-mime',
627                 'p7r' => 'application/x-pkcs7-certreqresp',
628                 'p7s' => 'application/pkcs7-signature',
629                 'p8' => 'application/pkcs8',
630                 'part' => 'application/pro_eng',
631                 'pas' => 'text/pascal',
632                 'paw' => 'application/vnd.pawaafile',
633                 'pbd' => 'application/vnd.powerbuilder6',
634                 'pbm' => 'image/x-portable-bitmap',
635                 'pcf' => 'application/x-font-pcf',
636                 'pcl' => 'application/vnd.hp-pcl',
637                 'pclxl' => 'application/vnd.hp-pclxl',
638                 'pct' => 'image/x-pict',
639                 'pcurl' => 'application/vnd.curl.pcurl',
640                 'pcx' => 'image/x-pcx',
641                 'pdb' => 'application/vnd.palm',
642                 'pdf' => 'application/pdf',
643                 'pfa' => 'application/x-font-type1',
644                 'pfr' => 'application/font-tdpfr',
645                 'pfunk' => 'audio/make.my.funk',
646                 'pgm' => 'image/x-portable-graymap',
647                 'pgn' => 'application/x-chess-pgn',
648                 'pgp' => 'application/pgp-signature',
649                 'php' => 'text/html',
650                 'pic' => 'image/x-pict',
651                 'pict' => 'image/pict',
652                 'pkg' => 'application/x-newton-compatible-pkg',
653                 'pki' => 'application/pkixcmp',
654                 'pkipath' => 'application/pkix-pkipath',
655                 'pko' => 'application/vnd.ms-pki.pko',
656                 'pl' => 'text/x-script.perl',
657                 'plb' => 'application/vnd.3gpp.pic-bw-large',
658                 'plc' => 'application/vnd.mobius.plc',
659                 'plf' => 'application/vnd.pocketlearn',
660                 'pls' => 'application/pls+xml',
661                 'plx' => 'application/x-pixclscript',
662                 'pm' => 'text/x-script.perl-module',
663                 'pm4' => 'application/x-pagemaker',
664                 'pm5' => 'application/x-pagemaker',
665                 'pml' => 'application/vnd.ctc-posml',
666                 'png' => 'image/png',
667                 'pnm' => 'image/x-portable-anymap',
668                 'portpkg' => 'application/vnd.macports.portpkg',
669                 'pot' => 'application/vnd.ms-powerpoint',
670                 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12',
671                 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
672                 'pov' => 'model/x-pov',
673                 'ppa' => 'application/vnd.ms-powerpoint',
674                 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12',
675                 'ppd' => 'application/vnd.cups-ppd',
676                 'ppm' => 'image/x-portable-pixmap',
677                 'pps' => 'application/vnd.ms-powerpoint',
678                 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
679                 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
680                 'ppt' => 'application/vnd.ms-powerpoint',
681                 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
682                 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
683                 'ppz' => 'application/mspowerpoint',
684                 'prc' => 'application/x-mobipocket-ebook',
685                 'pre' => 'application/vnd.lotus-freelance',
686                 'prf' => 'application/pics-rules',
687                 'prt' => 'application/pro_eng',
688                 'ps' => 'application/postscript',
689                 'psb' => 'application/vnd.3gpp.pic-bw-small',
690                 'psd' => 'image/vnd.adobe.photoshop',
691                 'psf' => 'application/x-font-linux-psf',
692                 'pskcxml' => 'application/pskc+xml',
693                 'ptid' => 'application/vnd.pvi.ptid1',
694                 'pub' => 'application/x-mspublisher',
695                 'pvb' => 'application/vnd.3gpp.pic-bw-var',
696                 'pvu' => 'paleovu/x-pv',
697                 'pwn' => 'application/vnd.3m.post-it-notes',
698                 'pwz' => 'application/vnd.ms-powerpoint',
699                 'py' => 'text/x-script.phyton',
700                 'pya' => 'audio/vnd.ms-playready.media.pya',
701                 'pyc' => 'applicaiton/x-bytecode.python',
702                 'pyv' => 'video/vnd.ms-playready.media.pyv',
703                 'qam' => 'application/vnd.epson.quickanime',
704                 'qbo' => 'application/vnd.intu.qbo',
705                 'qcp' => 'audio/vnd.qcelp',
706                 'qd3' => 'x-world/x-3dmf',
707                 'qd3d' => 'x-world/x-3dmf',
708                 'qfx' => 'application/vnd.intu.qfx',
709                 'qif' => 'image/x-quicktime',
710                 'qps' => 'application/vnd.publishare-delta-tree',
711                 'qt' => 'video/quicktime',
712                 'qtc' => 'video/x-qtc',
713                 'qti' => 'image/x-quicktime',
714                 'qtif' => 'image/x-quicktime',
715                 'qxd' => 'application/vnd.quark.quarkxpress',
716                 'ra' => 'audio/x-realaudio',
717                 'ram' => 'audio/x-pn-realaudio',
718                 'rar' => 'application/x-rar-compressed',
719                 'ras' => 'image/x-cmu-raster',
720                 'rast' => 'image/cmu-raster',
721                 'rcprofile' => 'application/vnd.ipunplugged.rcprofile',
722                 'rdf' => 'application/rdf+xml',
723                 'rdz' => 'application/vnd.data-vision.rdz',
724                 'rep' => 'application/vnd.businessobjects',
725                 'res' => 'application/x-dtbresource+xml',
726                 'rexx' => 'text/x-script.rexx',
727                 'rf' => 'image/vnd.rn-realflash',
728                 'rgb' => 'image/x-rgb',
729                 'rif' => 'application/reginfo+xml',
730                 'rip' => 'audio/vnd.rip',
731                 'rl' => 'application/resource-lists+xml',
732                 'rlc' => 'image/vnd.fujixerox.edmics-rlc',
733                 'rld' => 'application/resource-lists-diff+xml',
734                 'rm' => 'application/vnd.rn-realmedia',
735                 'rmi' => 'audio/mid',
736                 'rmm' => 'audio/x-pn-realaudio',
737                 'rmp' => 'audio/x-pn-realaudio-plugin',
738                 'rms' => 'application/vnd.jcp.javame.midlet-rms',
739                 'rnc' => 'application/relax-ng-compact-syntax',
740                 'rng' => 'application/vnd.nokia.ringing-tone',
741                 'rnx' => 'application/vnd.rn-realplayer',
742                 'roff' => 'application/x-troff',
743                 'rp' => 'image/vnd.rn-realpix',
744                 'rp9' => 'application/vnd.cloanto.rp9',
745                 'rpm' => 'audio/x-pn-realaudio-plugin',
746                 'rpss' => 'application/vnd.nokia.radio-presets',
747                 'rpst' => 'application/vnd.nokia.radio-preset',
748                 'rq' => 'application/sparql-query',
749                 'rs' => 'application/rls-services+xml',
750                 'rsd' => 'application/rsd+xml',
751                 'rss' => 'application/rss+xml',
752                 'rt' => 'text/vnd.rn-realtext',
753                 'rtf' => 'application/rtf',
754                 'rtx' => 'text/richtext',
755                 'rv' => 'video/vnd.rn-realvideo',
756                 's' => 'text/x-asm',
757                 's3m' => 'audio/s3m',
758                 'saf' => 'application/vnd.yamaha.smaf-audio',
759                 'saveme' => 'application/octet-stream',
760                 'sbk' => 'application/x-tbook',
761                 'sbml' => 'application/sbml+xml',
762                 'sc' => 'application/vnd.ibm.secure-container',
763                 'scd' => 'application/x-msschedule',
764                 'scm' => 'application/vnd.lotus-screencam',
765                 'scq' => 'application/scvp-cv-request',
766                 'scs' => 'application/scvp-cv-response',
767                 'scurl' => 'text/vnd.curl.scurl',
768                 'sda' => 'application/vnd.stardivision.draw',
769                 'sdc' => 'application/vnd.stardivision.calc',
770                 'sdd' => 'application/vnd.stardivision.impress',
771                 'sdkm' => 'application/vnd.solent.sdkm+xml',
772                 'sdml' => 'text/plain',
773                 'sdp' => 'application/sdp',
774                 'sdr' => 'application/sounder',
775                 'sdw' => 'application/vnd.stardivision.writer',
776                 'sea' => 'application/x-sea',
777                 'see' => 'application/vnd.seemail',
778                 'seed' => 'application/vnd.fdsn.seed',
779                 'sema' => 'application/vnd.sema',
780                 'semd' => 'application/vnd.semd',
781                 'semf' => 'application/vnd.semf',
782                 'ser' => 'application/java-serialized-object',
783                 'set' => 'application/set',
784                 'setpay' => 'application/set-payment-initiation',
785                 'setreg' => 'application/set-registration-initiation',
786                 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data',
787                 'sfs' => 'application/vnd.spotfire.sfs',
788                 'sgl' => 'application/vnd.stardivision.writer-global',
789                 'sgm' => 'text/x-sgml',
790                 'sgml' => 'text/sgml',
791                 'sh' => 'application/x-sh',
792                 'shar' => 'application/x-shar',
793                 'shf' => 'application/shf+xml',
794                 'shtml' => 'text/x-server-parsed-html',
795                 'sid' => 'audio/x-psid',
796                 'sis' => 'application/vnd.symbian.install',
797                 'sit' => 'application/x-stuffit',
798                 'sitx' => 'application/x-stuffitx',
799                 'skd' => 'application/x-koan',
800                 'skm' => 'application/x-koan',
801                 'skp' => 'application/vnd.koan',
802                 'skt' => 'application/x-koan',
803                 'sl' => 'application/x-seelogo',
804                 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
805                 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
806                 'slt' => 'application/vnd.epson.salt',
807                 'sm' => 'application/vnd.stepmania.stepchart',
808                 'smf' => 'application/vnd.stardivision.math',
809                 'smi' => 'application/smil+xml',
810                 'smil' => 'application/smil',
811                 'snd' => 'audio/x-adpcm',
812                 'snf' => 'application/x-font-snf',
813                 'sol' => 'application/solids',
814                 'spc' => 'text/x-speech',
815                 'spf' => 'application/vnd.yamaha.smaf-phrase',
816                 'spl' => 'application/x-futuresplash',
817                 'spot' => 'text/vnd.in3d.spot',
818                 'spp' => 'application/scvp-vp-response',
819                 'spq' => 'application/scvp-vp-request',
820                 'spr' => 'application/x-sprite',
821                 'sprite' => 'application/x-sprite',
822                 'src' => 'application/x-wais-source',
823                 'sru' => 'application/sru+xml',
824                 'srx' => 'application/sparql-results+xml',
825                 'sse' => 'application/vnd.kodak-descriptor',
826                 'ssf' => 'application/vnd.epson.ssf',
827                 'ssi' => 'text/x-server-parsed-html',
828                 'ssm' => 'application/streamingmedia',
829                 'ssml' => 'application/ssml+xml',
830                 'sst' => 'application/vnd.ms-pki.certstore',
831                 'st' => 'application/vnd.sailingtracker.track',
832                 'stc' => 'application/vnd.sun.xml.calc.template',
833                 'std' => 'application/vnd.sun.xml.draw.template',
834                 'step' => 'application/step',
835                 'stf' => 'application/vnd.wt.stf',
836                 'sti' => 'application/vnd.sun.xml.impress.template',
837                 'stk' => 'application/hyperstudio',
838                 'stl' => 'application/vnd.ms-pki.stl',
839                 'stp' => 'application/step',
840                 'str' => 'application/vnd.pg.format',
841                 'stw' => 'application/vnd.sun.xml.writer.template',
842                 'sub' => 'image/vnd.dvb.subtitle',
843                 'sus' => 'application/vnd.sus-calendar',
844                 'sv4cpio' => 'application/x-sv4cpio',
845                 'sv4crc' => 'application/x-sv4crc',
846                 'svc' => 'application/vnd.dvb.service',
847                 'svd' => 'application/vnd.svd',
848                 'svf' => 'image/x-dwg',
849                 'svg' => 'image/svg+xml',
850                 'svgz' => 'image/svg+xml',
851                 'svr' => 'x-world/x-svr',
852                 'swf' => 'application/x-shockwave-flash',
853                 'swi' => 'application/vnd.aristanetworks.swi',
854                 'sxc' => 'application/vnd.sun.xml.calc',
855                 'sxd' => 'application/vnd.sun.xml.draw',
856                 'sxg' => 'application/vnd.sun.xml.writer.global',
857                 'sxi' => 'application/vnd.sun.xml.impress',
858                 'sxm' => 'application/vnd.sun.xml.math',
859                 'sxw' => 'application/vnd.sun.xml.writer',
860                 't' => 'text/troff',
861                 'talk' => 'text/x-speech',
862                 'tao' => 'application/vnd.tao.intent-module-archive',
863                 'tar' => 'application/x-tar',
864                 'tbk' => 'application/x-tbook',
865                 'tcap' => 'application/vnd.3gpp2.tcap',
866                 'tcl' => 'application/x-tcl',
867                 'tcsh' => 'text/x-script.tcsh',
868                 'teacher' => 'application/vnd.smart.teacher',
869                 'tei' => 'application/tei+xml',
870                 'tex' => 'application/x-tex',
871                 'texi' => 'application/x-texinfo',
872                 'texinfo' => 'application/x-texinfo',
873                 'text' => 'text/plain',
874                 'tfi' => 'application/thraud+xml',
875                 'tfm' => 'application/x-tex-tfm',
876                 'tgz' => 'application/x-compressed',
877                 'thmx' => 'application/vnd.ms-officetheme',
878                 'tif' => 'image/tiff',
879                 'tiff' => 'image/tiff',
880                 'tmo' => 'application/vnd.tmobile-livetv',
881                 'torrent' => 'application/x-bittorrent',
882                 'tpl' => 'application/vnd.groove-tool-template',
883                 'tpt' => 'application/vnd.trid.tpt',
884                 'tr' => 'application/x-troff',
885                 'tra' => 'application/vnd.trueapp',
886                 'trm' => 'application/x-msterminal',
887                 'tsd' => 'application/timestamped-data',
888                 'tsi' => 'audio/tsp-audio',
889                 'tsp' => 'audio/tsplayer',
890                 'tsv' => 'text/tab-separated-values',
891                 'ttf' => 'application/x-font-ttf',
892                 'ttl' => 'text/turtle',
893                 'turbot' => 'image/florian',
894                 'twd' => 'application/vnd.simtech-mindmapper',
895                 'txd' => 'application/vnd.genomatix.tuxedo',
896                 'txf' => 'application/vnd.mobius.txf',
897                 'txt' => 'text/plain',
898                 'ufd' => 'application/vnd.ufdl',
899                 'uil' => 'text/x-uil',
900                 'umj' => 'application/vnd.umajin',
901                 'uni' => 'text/uri-list',
902                 'unis' => 'text/uri-list',
903                 'unityweb' => 'application/vnd.unity',
904                 'unv' => 'application/i-deas',
905                 'uoml' => 'application/vnd.uoml+xml',
906                 'uri' => 'text/uri-list',
907                 'uris' => 'text/uri-list',
908                 'ustar' => 'application/x-ustar',
909                 'utz' => 'application/vnd.uiq.theme',
910                 'uu' => 'text/x-uuencode',
911                 'uue' => 'text/x-uuencode',
912                 'uva' => 'audio/vnd.dece.audio',
913                 'uvh' => 'video/vnd.dece.hd',
914                 'uvi' => 'image/vnd.dece.graphic',
915                 'uvm' => 'video/vnd.dece.mobile',
916                 'uvp' => 'video/vnd.dece.pd',
917                 'uvs' => 'video/vnd.dece.sd',
918                 'uvu' => 'video/vnd.uvvu.mp4',
919                 'uvv' => 'video/vnd.dece.video',
920                 'vcd' => 'application/x-cdlink',
921                 'vcf' => 'text/x-vcard',
922                 'vcg' => 'application/vnd.groove-vcard',
923                 'vcs' => 'text/x-vcalendar',
924                 'vcx' => 'application/vnd.vcx',
925                 'vda' => 'application/vda',
926                 'vdo' => 'video/vdo',
927                 'vew' => 'application/groupwise',
928                 'vis' => 'application/vnd.visionary',
929                 'viv' => 'video/vnd.vivo',
930                 'vivo' => 'video/vnd.vivo',
931                 'vmd' => 'application/vocaltec-media-desc',
932                 'vmf' => 'application/vocaltec-media-file',
933                 'voc' => 'audio/x-voc',
934                 'vos' => 'video/vosaic',
935                 'vox' => 'audio/voxware',
936                 'vqe' => 'audio/x-twinvq-plugin',
937                 'vqf' => 'audio/x-twinvq',
938                 'vql' => 'audio/x-twinvq-plugin',
939                 'vrml' => 'x-world/x-vrml',
940                 'vrt' => 'x-world/x-vrt',
941                 'vsd' => 'application/vnd.visio',
942                 'vsf' => 'application/vnd.vsf',
943                 'vst' => 'application/x-visio',
944                 'vsw' => 'application/x-visio',
945                 'vtu' => 'model/vnd.vtu',
946                 'vxml' => 'application/voicexml+xml',
947                 'w60' => 'application/wordperfect6.0',
948                 'w61' => 'application/wordperfect6.1',
949                 'w6w' => 'application/msword',
950                 'wad' => 'application/x-doom',
951                 'wav' => 'audio/wav',
952                 'wax' => 'audio/x-ms-wax',
953                 'wb1' => 'application/x-qpro',
954                 'wbmp' => 'image/vnd.wap.wbmp',
955                 'wbs' => 'application/vnd.criticaltools.wbs+xml',
956                 'wbxml' => 'application/vnd.wap.wbxml',
957                 'web' => 'application/vnd.xara',
958                 'weba' => 'audio/webm',
959                 'webm' => 'video/webm',
960                 'webp' => 'image/webp',
961                 'wg' => 'application/vnd.pmi.widget',
962                 'wgt' => 'application/widget',
963                 'wiz' => 'application/msword',
964                 'wk1' => 'application/x-123',
965                 'wm' => 'video/x-ms-wm',
966                 'wma' => 'audio/x-ms-wma',
967                 'wmd' => 'application/x-ms-wmd',
968                 'wmf' => 'application/x-msmetafile',
969                 'wml' => 'text/vnd.wap.wml',
970                 'wmlc' => 'application/vnd.wap.wmlc',
971                 'wmls' => 'text/vnd.wap.wmlscript',
972                 'wmlsc' => 'application/vnd.wap.wmlscriptc',
973                 'wmv' => 'video/x-ms-wmv',
974                 'wmx' => 'video/x-ms-wmx',
975                 'wmz' => 'application/x-ms-wmz',
976                 'woff' => 'application/x-font-woff',
977                 'word' => 'application/msword',
978                 'wp' => 'application/wordperfect',
979                 'wp5' => 'application/wordperfect6.0',
980                 'wp6' => 'application/wordperfect',
981                 'wpd' => 'application/vnd.wordperfect',
982                 'wpl' => 'application/vnd.ms-wpl',
983                 'wps' => 'application/vnd.ms-works',
984                 'wq1' => 'application/x-lotus',
985                 'wqd' => 'application/vnd.wqd',
986                 'wri' => 'application/x-mswrite',
987                 'wrl' => 'model/vrml',
988                 'wrz' => 'x-world/x-vrml',
989                 'wsc' => 'text/scriplet',
990                 'wsdl' => 'application/wsdl+xml',
991                 'wspolicy' => 'application/wspolicy+xml',
992                 'wsrc' => 'application/x-wais-source',
993                 'wtb' => 'application/vnd.webturbo',
994                 'wtk' => 'application/x-wintalk',
995                 'wvx' => 'video/x-ms-wvx',
996                 'x-png' => 'image/png',
997                 'x3d' => 'application/vnd.hzn-3d-crossword',
998                 'xap' => 'application/x-silverlight-app',
999                 'xar' => 'application/vnd.xara',
1000                 'xbap' => 'application/x-ms-xbap',
1001                 'xbd' => 'application/vnd.fujixerox.docuworks.binder',
1002                 'xbm' => 'image/x-xbitmap',
1003                 'xdf' => 'application/xcap-diff+xml',
1004                 'xdm' => 'application/vnd.syncml.dm+xml',
1005                 'xdp' => 'application/vnd.adobe.xdp+xml',
1006                 'xdr' => 'video/x-amt-demorun',
1007                 'xdssc' => 'application/dssc+xml',
1008                 'xdw' => 'application/vnd.fujixerox.docuworks',
1009                 'xenc' => 'application/xenc+xml',
1010                 'xer' => 'application/patch-ops-error+xml',
1011                 'xfdf' => 'application/vnd.adobe.xfdf',
1012                 'xfdl' => 'application/vnd.xfdl',
1013                 'xgz' => 'xgl/drawing',
1014                 'xhtml' => 'application/xhtml+xml',
1015                 'xif' => 'image/vnd.xiff',
1016                 'xl' => 'application/excel',
1017                 'xla' => 'application/x-msexcel',
1018                 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12',
1019                 'xlb' => 'application/x-excel',
1020                 'xlc' => 'application/x-excel',
1021                 'xld' => 'application/x-excel',
1022                 'xlk' => 'application/x-excel',
1023                 'xll' => 'application/x-excel',
1024                 'xlm' => 'application/x-excel',
1025                 'xls' => 'application/vnd.ms-excel',
1026                 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
1027                 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12',
1028                 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
1029                 'xlt' => 'application/x-excel',
1030                 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12',
1031                 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
1032                 'xlv' => 'application/x-excel',
1033                 'xlw' => 'application/x-msexcel',
1034                 'xm' => 'audio/xm',
1035                 'xml' => 'application/xml',
1036                 'xmz' => 'xgl/movie',
1037                 'xo' => 'application/vnd.olpc-sugar',
1038                 'xop' => 'application/xop+xml',
1039                 'xpi' => 'application/x-xpinstall',
1040                 'xpix' => 'application/x-vnd.ls-xpix',
1041                 'xpm' => 'image/x-xpixmap',
1042                 'xpr' => 'application/vnd.is-xpr',
1043                 'xps' => 'application/vnd.ms-xpsdocument',
1044                 'xpw' => 'application/vnd.intercon.formnet',
1045                 'xslt' => 'application/xslt+xml',
1046                 'xsm' => 'application/vnd.syncml+xml',
1047                 'xspf' => 'application/xspf+xml',
1048                 'xsr' => 'video/x-amt-showrun',
1049                 'xul' => 'application/vnd.mozilla.xul+xml',
1050                 'xwd' => 'image/x-xwindowdump',
1051                 'xyz' => 'chemical/x-xyz',
1052                 'yang' => 'application/yang',
1053                 'yin' => 'application/yin+xml',
1054                 'z' => 'application/x-compressed',
1055                 'zaz' => 'application/vnd.zzazz.deck+xml',
1056                 'zip' => 'application/zip',
1057                 'zir' => 'application/vnd.zul',
1058                 'zmm' => 'application/vnd.handheld-entertainment+xml',
1059                 'zoo' => 'application/octet-stream',
1060                 'zsh' => 'text/x-script.zsh',
1061         );
1062
1063         $dot = strpos($filename,'.');
1064         if($dot !== false) {
1065                 $ext = strtolower(substr($filename,$dot+1));
1066                 if (array_key_exists($ext, $mime_types)) {
1067                         return $mime_types[$ext];
1068                 }
1069         }
1070 // can't use this because we're just passing a name, e.g. not a file that can be opened
1071 //      elseif (function_exists('finfo_open')) {
1072 //              $finfo = @finfo_open(FILEINFO_MIME);
1073 //              $mimetype = @finfo_file($finfo, $filename);
1074 //              @finfo_close($finfo);
1075 //              return $mimetype;
1076 //      }
1077         else {
1078                 return 'application/octet-stream';
1079         }
1080 }
1081