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