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