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