source: trunk/phpgwapi/inc/class.mime_magic.inc.php @ 2

Revision 2, 42.5 KB checked in by niltonneto, 17 years ago (diff)

Removida todas as tags usadas pelo CVS ($Id, $Source).
Primeira versão no CVS externo.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2  /********************************************************************\
3  * eGroupWare - eGroupWare API - mime magic                           *
4  * http://www.egroupware.org                                          *
5  * This program is part of the GNU project, see http://www.gnu.org    *
6  *                                                                    *
7  * Originally taken from the Horde Framework http://horde.org         *
8  *                                                                    *
9  * Copyright 1999-2003 Anil Madhavapeddy <anil@recoil.org>            *
10  * Copyright 2002-2003 Michael Slusarz <slusarz@bigworm.colorado.edu> *
11  * Copyright 2003 Free Software Foundation, Inc.                      *
12  *                                                                    *
13  * Ported to phpGroupWare by Dave Hall - dave.hall@mbox.com.au        *
14  * Note: this class was relicensed as GPL by Dave Hall - all mods GPL *
15  * --------------------------------------------                       *
16  *  This program is Free Software; you can redistribute it and/or     *
17  *  modify it under the terms of the GNU General Public License as    *
18  *  published by the Free Software Foundation; either version 2 of    *
19  *  the License, or (at your option) any later version.               *
20  \********************************************************************/
21
22
23        class mime_magic
24        {
25                //extension to mime type map
26                var $mime_extension_map;
27
28                //map of file contents to mime type
29                var $mime_magic_file;
30               
31                /**
32                * Wrapper to PHP5 Compatiable Constructor
33                *
34                * @author skwashd
35               
36                function mime_magic()
37                {
38                        $this->__constructor()
39                }
40                */
41
42                /**
43                * Constructor
44                *
45                * Load the map values into the instance arrays
46                * @author skwashd
47                */
48                function mime_magic() //__constructor()
49                {
50                        $this->mime_extension_map = $this->get_mime_ext_map();
51                        $this->mime_magic_file = $this->get_mime_magic_file();
52                }
53
54                /**
55                * Attempt to convert a file extension to a MIME type
56                *
57                * This is the simplest MIME type guessing function - rough but fast.
58                * If the MIME type is not found then 'application/octet-stream'
59                * is returned.
60                *
61                * @access public
62                *
63                * @param string $ext  The file extension to be mapped to a MIME type.
64                *
65                * @return string  The MIME type of the file extension.
66                */
67                function ext2mime($ext)
68                {
69                        if (empty($ext))
70                        {
71                                return 'text/plain';//assume no extension is a text file
72                        }
73                        else
74                        {
75                                $ext = strtolower($ext);
76                                if (!array_key_exists($ext, $this->mime_extension_map))
77                                {
78                                        return 'application/octet-stream';
79                                }
80                                else
81                                {
82                                        return $this->mime_extension_map[$ext];
83                                }
84                        }
85                }
86
87                /**
88                * Attempt to convert a filename to a MIME type, based on the
89                * global and application specific config files.
90                *
91                * Unlike ext2mime, this function will return
92                * 'application/octet-stream' for any unknown or empty extension
93                *
94                * @access public
95                *
96                * @param string $filename  The filename to be mapped to a MIME type.
97                *
98                * @return string  The MIME type of the filename.
99                * @author skwashd - changed it to make it work with file.tar.gz etc
100                */
101                function filename2mime($filename)
102                {
103                        $fn_parts = explode('.', $filename);
104                        if (is_array($fn_parts))
105                        {
106                                return $this->ext2mime($fn_parts[count($fn_parts)-1]);
107                        }
108                        return 'application/octet-stream';
109                }
110
111                /* temporary fix for apps using the old name */
112                function filename2mine($filename)
113                {
114                        return $this->filename2mime($filename);
115                }
116
117                /**
118                * Attempt to convert a MIME type to a file extension, based
119                * on the global Horde and application specific config files.
120                *
121                * If we cannot map the type to a file extension, we return false.
122                *
123                * @access public
124                *
125                * @param string $type  The MIME type to be mapped to a file extension.
126                *
127                * @return string  The file extension of the MIME type.
128                */
129                function mime2ext($type)
130                {
131                        $key = array_search($type, $this->mime_extension_map);
132                        if (empty($type) || ($key === false))
133                        {
134                                return false;
135                        }
136                        else
137                        {
138                                return $key;
139                        }
140                }
141
142                /**
143                * Uses variants of the UNIX "file" command to attempt to determine the
144                * MIME type of an unknown file.
145                *
146                * @access public
147                *
148                * @param string $filename The filename (including full path) to the file to analyze.
149                *
150                * @return string  The MIME type of the file.  Returns false if either
151                *                 the file type isn't recognized or the file command is
152                *                 not available.
153                */
154                function analyze_file($path)
155                {
156                        /* If the PHP Mimetype extension is available, use that. */
157                        if (function_exists('mime_content_type'))
158                        {
159                                return mime_content_type($path);
160                        }
161                        else
162                        {
163                                /* Use a built-in magic file. */
164                                if (!($fp = @fopen($path, 'rb')))
165                                {
166                                        return false;
167                                }
168                                foreach ($this->mime_magic_file as $offset => $odata)
169                                {
170                                        foreach ($odata as $length => $ldata)
171                                        {
172                                                @fseek($fp, $offset, SEEK_SET);
173                                                $lookup = @fread($fp, $length);
174                                                if (!empty($ldata[$lookup]))
175                                                {
176                                                        fclose($fp);
177                                                        return $ldata[$lookup];
178                                                }
179                                        }
180                                }
181                                fclose($fp);
182                        }
183                        return false;
184                }
185
186                /**
187                * Instead of using an existing file a chunk of data is used for
188                * testing.  Best to handle the file creation here, to make sure
189                * it is secure and it is properly cleaned up.  Really just
190                * a temp file creation and clean up method wrapper for analyze_file()
191                *
192                * @param string $data the data to analyze
193                *
194                * @param string MIME type false for none.
195                *
196                * @author skwashd
197                */
198                function analyze_data($data)
199                {
200                        if(!is_writeable(@$GLOBALS['phpgw_info']['server']['temp_dir']))
201                        {
202                                //nothing we can do but bail out
203                                return false;
204                        }
205
206                        mt_srand(time());
207                        $filename = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP
208                                . md5( time() + mt_rand() ) . '.tmp';
209
210                        $fp = @fopen($filename, 'ab');
211                        if(!$fp || !$data)
212                        {
213                                //houston we have a problem - bail out
214                                return false;
215                        }
216
217                        if(!fwrite($fp, $data))
218                        {
219                                //bail out again
220                                return false;
221                        }
222                        fclose($fp);
223                        chmod($filename, 0600); //just to be cautious
224
225                        $mime = $this->analyze_file($filename);
226
227                        unlink($filename);//remove the temp file
228
229                        return $mime;
230                }
231
232                /**
233                * Get an array containing a mapping of common file extensions to
234                * MIME types.
235                *
236                * Original array taken from http://horde.org
237                *
238                * @author skwashd
239                *
240                * @return array of extenstion to mime mappings
241                */
242                function get_mime_ext_map()
243                {
244                        return array(
245                                'ai'    => 'application/postscript',
246                                'aif'   => 'audio/x-aiff',
247                                'aifc'  => 'audio/x-aiff',
248                                'aiff'  => 'audio/x-aiff',
249                                'asc'   => 'application/pgp', //changed by skwashd - was text/plain
250                                'asf'   => 'video/x-ms-asf',
251                                'asx'   => 'video/x-ms-asf',
252                                'au'    => 'audio/basic',
253                                'avi'   => 'video/x-msvideo',
254                                'bcpio' => 'application/x-bcpio',
255                                'bin'   => 'application/octet-stream',
256                                'bmp'   => 'image/bmp',
257                                'c'     => 'text/plain', // or 'text/x-csrc', //added by skwashd
258                                'c++'   => 'text/plain', // or 'text/x-c++src', //added by skwashd
259                                'cc'    => 'text/plain', // or 'text/x-c++src', //added by skwashd
260                                'cs'    => 'text/plain', //added by skwashd - for C# src
261                                'cpp'   => 'text/x-c++src', //added by skwashd
262                                'cxx'   => 'text/x-c++src', //added by skwashd
263                                'cdf'   => 'application/x-netcdf',
264                                'class' => 'application/octet-stream',//secure but application/java-class is correct
265                                'com'   => 'application/octet-stream',//added by skwashd
266                                'cpio'  => 'application/x-cpio',
267                                'cpt'   => 'application/mac-compactpro',
268                                'csh'   => 'application/x-csh',
269                                'css'   => 'text/css',
270                                'csv'   => 'text/comma-separated-values',//added by skwashd
271                                'dcr'   => 'application/x-director',
272                                'diff'  => 'text/diff',
273                                'dir'   => 'application/x-director',
274                                'dll'   => 'application/octet-stream',
275                                'dms'   => 'application/octet-stream',
276                                'doc'   => 'application/msword',
277                                'dot'   => 'application/msword',//added by skwashd
278                                'dvi'   => 'application/x-dvi',
279                                'dxr'   => 'application/x-director',
280                                'eps'   => 'application/postscript',
281                                'etx'   => 'text/x-setext',
282                                'exe'   => 'application/octet-stream',
283                                'ez'    => 'application/andrew-inset',
284                                'gif'   => 'image/gif',
285                                'gtar'  => 'application/x-gtar',
286                                'gz'    => 'application/x-gzip',
287                                'h'     => 'text/plain', // or 'text/x-chdr',//added by skwashd
288                                'h++'   => 'text/plain', // or 'text/x-c++hdr', //added by skwashd
289                                'hh'    => 'text/plain', // or 'text/x-c++hdr', //added by skwashd
290                                'hpp'   => 'text/plain', // or 'text/x-c++hdr', //added by skwashd
291                                'hxx'   => 'text/plain', // or 'text/x-c++hdr', //added by skwashd
292                                'hdf'   => 'application/x-hdf',
293                                'hqx'   => 'application/mac-binhex40',
294                                'htm'   => 'text/html',
295                                'html'  => 'text/html',
296                                'ice'   => 'x-conference/x-cooltalk',
297                                'ics'   => 'text/calendar',
298                                'ief'   => 'image/ief',
299                                'ifb'   => 'text/calendar',
300                                'iges'  => 'model/iges',
301                                'igs'   => 'model/iges',
302                                'jar'   => 'application/x-jar', //added by skwashd - alternative mime type
303                                'java'  => 'text/x-java-source', //added by skwashd
304                                'jpe'   => 'image/jpeg',
305                                'jpeg'  => 'image/jpeg',
306                                'jpg'   => 'image/jpeg',
307                                'js'    => 'application/x-javascript',
308                                'kar'   => 'audio/midi',
309                                'latex' => 'application/x-latex',
310                                'lha'   => 'application/octet-stream',
311                                'log'   => 'text/plain',
312                                'lzh'   => 'application/octet-stream',
313                                'm3u'   => 'audio/x-mpegurl',
314                                'man'   => 'application/x-troff-man',
315                                'me'    => 'application/x-troff-me',
316                                'mesh'  => 'model/mesh',
317                                'mid'   => 'audio/midi',
318                                'midi'  => 'audio/midi',
319                                'mif'   => 'application/vnd.mif',
320                                'mov'   => 'video/quicktime',
321                                'movie' => 'video/x-sgi-movie',
322                                'mp2'   => 'audio/mpeg',
323                                'mp3'   => 'audio/mpeg',
324                                'mpe'   => 'video/mpeg',
325                                'mpeg'  => 'video/mpeg',
326                                'mpg'   => 'video/mpeg',
327                                'mpga'  => 'audio/mpeg',
328                                'ms'    => 'application/x-troff-ms',
329                                'msh'   => 'model/mesh',
330                                'mxu'   => 'video/vnd.mpegurl',
331                                'nc'    => 'application/x-netcdf',
332                                'oda'   => 'application/oda',
333                                'patch' => 'text/diff',
334                                'pbm'   => 'image/x-portable-bitmap',
335                                'pdb'   => 'chemical/x-pdb',
336                                'pdf'   => 'application/pdf',
337                                'pgm'   => 'image/x-portable-graymap',
338                                'pgn'   => 'application/x-chess-pgn',
339                                'pgp'   => 'application/pgp',//added by skwashd
340                                'php'   => 'application/x-httpd-php',
341                                'php3'  => 'application/x-httpd-php3',
342                                'pl'    => 'application/x-perl',
343                                'pm'    => 'application/x-perl',
344                                'png'   => 'image/png',
345                                'pnm'   => 'image/x-portable-anymap',
346                                'po'    => 'text/plain',
347                                'ppm'   => 'image/x-portable-pixmap',
348                                'ppt'   => 'application/vnd.ms-powerpoint',
349                                'ps'    => 'application/postscript',
350                                'qt'    => 'video/quicktime',
351                                'ra'    => 'audio/x-realaudio',
352                                'ram'   => 'audio/x-pn-realaudio',
353                                'ras'   => 'image/x-cmu-raster',
354                                'rgb'   => 'image/x-rgb',
355                                'rm'    => 'audio/x-pn-realaudio',
356                                'roff'  => 'application/x-troff',
357                                'rpm'   => 'audio/x-pn-realaudio-plugin',
358                                'rtf'   => 'text/rtf',
359                                'rtx'   => 'text/richtext',
360                                'sgm'   => 'text/sgml',
361                                'sgml'  => 'text/sgml',
362                                'sh'    => 'application/x-sh',
363                                'shar'  => 'application/x-shar',
364                                'shtml' => 'text/html',
365                                'silo'  => 'model/mesh',
366                                'sit'   => 'application/x-stuffit',
367                                'skd'   => 'application/x-koan',
368                                'skm'   => 'application/x-koan',
369                                'skp'   => 'application/x-koan',
370                                'skt'   => 'application/x-koan',
371                                'smi'   => 'application/smil',
372                                'smil'  => 'application/smil',
373                                'snd'   => 'audio/basic',
374                                'so'    => 'application/octet-stream',
375                                'spl'   => 'application/x-futuresplash',
376                                'src'   => 'application/x-wais-source',
377                                'stc'   => 'application/vnd.sun.xml.calc.template',
378                                'std'   => 'application/vnd.sun.xml.draw.template',
379                                'sti'   => 'application/vnd.sun.xml.impress.template',
380                                'stw'   => 'application/vnd.sun.xml.writer.template',
381                                'sv4cpio'       => 'application/x-sv4cpio',
382                                'sv4crc'        => 'application/x-sv4crc',
383                                'swf'   => 'application/x-shockwave-flash',
384                                'sxc'   => 'application/vnd.sun.xml.calc',
385                                'sxd'   => 'application/vnd.sun.xml.draw',
386                                'sxg'   => 'application/vnd.sun.xml.writer.global',
387                                'sxi'   => 'application/vnd.sun.xml.impress',
388                                'sxm'   => 'application/vnd.sun.xml.math',
389                                'sxw'   => 'application/vnd.sun.xml.writer',
390                                't'     => 'application/x-troff',
391                                'tar'   => 'application/x-tar',
392                                'tcl'   => 'application/x-tcl',
393                                'tex'   => 'application/x-tex',
394                                'texi'  => 'application/x-texinfo',
395                                'texinfo'       => 'application/x-texinfo',
396                                'tgz'   => 'application/x-gtar',
397                                'tif'   => 'image/tiff',
398                                'tiff'  => 'image/tiff',
399                                'tr'    => 'application/x-troff',
400                                'tsv'   => 'text/tab-separated-values',
401                                'txt'   => 'text/plain',
402                                'ustar' => 'application/x-ustar',
403                                'vbs'   => 'text/plain', //added by skwashd - for obvious reasons
404                                'vcd'   => 'application/x-cdlink',
405                                'vcf'   => 'text/x-vcard',
406                                'vcs'   => 'text/calendar',
407                                'vfb'   => 'text/calendar',
408                                'vrml'  => 'model/vrml',
409                                'vsd'   => 'application/vnd.visio',
410                                'wav'   => 'audio/x-wav',
411                                'wax'   => 'audio/x-ms-wax',
412                                'wbmp'  => 'image/vnd.wap.wbmp',
413                                'wbxml' => 'application/vnd.wap.wbxml',
414                                'wm'    => 'video/x-ms-wm',
415                                'wma'   => 'audio/x-ms-wma',
416                                'wmd'   => 'application/x-ms-wmd',
417                                'wml'   => 'text/vnd.wap.wml',
418                                'wmlc'  => 'application/vnd.wap.wmlc',
419                                'wmls'  => 'text/vnd.wap.wmlscript',
420                                'wmlsc' => 'application/vnd.wap.wmlscriptc',
421                                'wmv'   => 'video/x-ms-wmv',
422                                'wmx'   => 'video/x-ms-wmx',
423                                'wmz'   => 'application/x-ms-wmz',
424                                'wrl'   => 'model/vrml',
425                                'wvx'   => 'video/x-ms-wvx',
426                                'xbm'   => 'image/x-xbitmap',
427                                'xht'   => 'application/xhtml+xml',
428                                'xhtml' => 'application/xhtml+xml',
429                                'xls'   => 'application/vnd.ms-excel',
430                                'xlt'   => 'application/vnd.ms-excel',
431                                'xml'   => 'application/xml',
432                                'xpm'   => 'image/x-xpixmap',
433                                'xsl'   => 'text/xml',
434                                'xwd'   => 'image/x-xwindowdump',
435                                'xyz'   => 'chemical/x-xyz',
436                                'z'     => 'application/x-compress',
437                                'zip'   => 'application/zip',
438                        );
439                }
440
441                /**
442                * Get the mime magic mapping file - last resort test
443                *
444                * Note Taken from horde.org - no copyright notice attached
445                *
446                * @author skwashd - converted to a function
447                *
448                * @return array mime magic data
449                */
450                function get_mime_magic_file()
451                {
452                        $mime_magic[0][30]["\145\166\141\154\40\42\145\170\145\143\40\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
453        $mime_magic[0][24]["\145\166\141\154\40\42\145\170\145\143\40\57\165\163\162\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
454                        $mime_magic[0][23]["\103\157\155\155\157\156\40\163\165\142\144\151\162\145\143\164\157\162\151\145\163\72\40"] = 'text/x-patch';
455                        $mime_magic[0][23]["\75\74\154\151\163\164\76\156\74\160\162\157\164\157\143\157\154\40\142\142\156\55\155"] = 'application/data';
456                        $mime_magic[0][22]["\101\115\101\116\104\101\72\40\124\101\120\105\123\124\101\122\124\40\104\101\124\105"] = 'application/x-amanda-header';
457                        $mime_magic[0][22]["\107\106\61\120\101\124\103\110\61\60\60\60\111\104\43\60\60\60\60\60\62\60"] = 'audio/x-gus-patch';
458                        $mime_magic[0][22]["\107\106\61\120\101\124\103\110\61\61\60\60\111\104\43\60\60\60\60\60\62\60"] = 'audio/x-gus-patch';
459                        $mime_magic[0][22]["\43\41\11\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\142\141\163\150"] = 'application/x-sh';
460                        $mime_magic[0][22]["\43\41\11\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\147\141\167\153"] = 'application/x-awk';
461                        $mime_magic[0][22]["\43\41\11\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\156\141\167\153"] = 'application/x-awk';
462                        $mime_magic[0][22]["\43\41\11\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
463                        $mime_magic[0][22]["\43\41\11\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\164\143\163\150"] = 'application/x-csh';
464                        $mime_magic[0][22]["\43\41\40\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\142\141\163\150"] = 'application/x-sh';
465                        $mime_magic[0][22]["\43\41\40\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\147\141\167\153"] = 'application/x-awk';
466                        $mime_magic[0][22]["\43\41\40\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\156\141\167\153"] = 'application/x-awk';
467                        $mime_magic[0][22]["\43\41\40\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
468                        $mime_magic[0][22]["\43\41\40\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\164\143\163\150"] = 'application/x-csh';
469                        $mime_magic[0][21]["\43\41\11\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\141\163\150"] = 'application/x-zsh';
470                        $mime_magic[0][21]["\43\41\11\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\172\163\150"] = 'application/x-zsh';
471                        $mime_magic[0][21]["\43\41\40\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\141\163\150"] = 'application/x-zsh';
472                        $mime_magic[0][21]["\43\41\40\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\172\163\150"] = 'application/x-zsh';
473                        $mime_magic[0][21]["\43\41\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\142\141\163\150"] = 'application/x-sh';
474                        $mime_magic[0][21]["\43\41\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\147\141\167\153"] = 'application/x-awk';
475                        $mime_magic[0][21]["\43\41\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\156\141\167\153"] = 'application/x-awk';
476                        $mime_magic[0][21]["\43\41\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
477                        $mime_magic[0][21]["\43\41\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\164\143\163\150"] = 'application/x-csh';
478                        $mime_magic[0][20]["\145\166\141\154\40\42\145\170\145\143\40\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
479                        $mime_magic[0][20]["\43\41\11\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\141\145"] = 'text/script';
480                        $mime_magic[0][20]["\43\41\40\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\141\145"] = 'text/script';
481                        $mime_magic[0][20]["\43\41\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\141\163\150"] = 'application/x-sh';
482                        $mime_magic[0][20]["\43\41\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\172\163\150"] = 'application/x-zsh';
483                        $mime_magic[0][19]["\103\162\145\141\164\151\166\145\40\126\157\151\143\145\40\106\151\154\145"] = 'audio/x-voc';
484                        $mime_magic[0][19]["\41\74\141\162\143\150\76\156\137\137\137\137\137\137\137\137\137\137\105"] = 'application/x-ar';
485                        $mime_magic[0][19]["\41\74\141\162\143\150\76\156\137\137\137\137\137\137\137\137\66\64\105"] = 'application/data';
486                        $mime_magic[0][19]["\43\41\57\165\163\162\57\154\157\143\141\154\57\142\151\156\57\141\145"] = 'text/script';
487                        $mime_magic[0][18]["\106\151\114\145\123\164\101\162\124\146\111\154\105\163\124\141\122\164"] = 'text/x-apple-binscii';
488                        $mime_magic[0][18]["\43\41\40\57\165\163\162\57\154\157\143\141\154\57\164\143\163\150"] = 'application/x-csh';
489                        $mime_magic[0][18]["\45\41\120\123\55\101\144\157\142\145\106\157\156\164\55\61\56\60"] = 'font/type1';
490                        $mime_magic[0][17]["\43\41\57\165\163\162\57\154\157\143\141\154\57\164\143\163\150"] = 'application/x-csh';
491                        $mime_magic[0][16]["\105\170\164\145\156\144\145\144\40\115\157\144\165\154\145\72"] = 'audio/x-ft2-mod';
492                        $mime_magic[0][16]["\123\164\141\162\164\106\157\156\164\115\145\164\162\151\143\163"] = 'font/x-sunos-news';
493                        $mime_magic[0][16]["\43\41\11\57\165\163\162\57\142\151\156\57\147\141\167\153"] = 'application/x-awk';
494                        $mime_magic[0][16]["\43\41\11\57\165\163\162\57\142\151\156\57\156\141\167\153"] = 'application/x-awk';
495                        $mime_magic[0][16]["\43\41\11\57\165\163\162\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
496                        $mime_magic[0][16]["\43\41\40\57\165\163\162\57\142\151\156\57\147\141\167\153"] = 'application/x-awk';
497                        $mime_magic[0][16]["\43\41\40\57\165\163\162\57\142\151\156\57\156\141\167\153"] = 'application/x-awk';
498                        $mime_magic[0][16]["\43\41\40\57\165\163\162\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
499                        $mime_magic[0][16]["\74\115\141\153\145\162\104\151\143\164\151\157\156\141\162\171"] = 'application/x-framemaker';
500                        $mime_magic[0][16]["\74\115\141\153\145\162\123\143\162\145\145\156\106\157\156\164"] = 'font/x-framemaker';
501                        $mime_magic[0][15]["\43\41\11\57\165\163\162\57\142\151\156\57\141\167\153"] = 'application/x-awk';
502                        $mime_magic[0][15]["\43\41\40\57\165\163\162\57\142\151\156\57\141\167\153"] = 'application/x-awk';
503                        $mime_magic[0][15]["\43\41\57\165\163\162\57\142\151\156\57\147\141\167\153"] = 'application/x-awk';
504                        $mime_magic[0][15]["\43\41\57\165\163\162\57\142\151\156\57\156\141\167\153"] = 'application/x-awk';
505                        $mime_magic[0][15]["\43\41\57\165\163\162\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
506                        $mime_magic[0][14]["\41\74\141\162\143\150\76\156\144\145\142\151\141\156"] = 'application/x-dpkg';
507                        $mime_magic[0][14]["\43\41\57\165\163\162\57\142\151\156\57\141\167\153"] = 'application/x-awk';
508                        $mime_magic[0][14]["\74\41\104\117\103\124\131\120\105\40\110\124\115\114"] = 'text/html';
509                        $mime_magic[0][14]["\74\41\144\157\143\164\171\160\145\40\150\164\155\154"] = 'text/html';
510                        $mime_magic[0][13]["\107\111\115\120\40\107\162\141\144\151\145\156\164"] = 'application/x-gimp-gradient';
511                        $mime_magic[0][12]["\122\145\164\165\162\156\55\120\141\164\150\72"] = 'message/rfc822';
512                        $mime_magic[0][12]["\43\41\11\57\142\151\156\57\142\141\163\150"] = 'application/x-sh';
513                        $mime_magic[0][12]["\43\41\11\57\142\151\156\57\147\141\167\153"] = 'application/x-awk';
514                        $mime_magic[0][12]["\43\41\11\57\142\151\156\57\156\141\167\153"] = 'application/x-awk';
515                        $mime_magic[0][12]["\43\41\11\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
516                        $mime_magic[0][12]["\43\41\11\57\142\151\156\57\164\143\163\150"] = 'application/x-csh';
517                        $mime_magic[0][12]["\43\41\40\57\142\151\156\57\142\141\163\150"] = 'application/x-sh';
518                        $mime_magic[0][12]["\43\41\40\57\142\151\156\57\147\141\167\153"] = 'application/x-awk';
519                        $mime_magic[0][12]["\43\41\40\57\142\151\156\57\156\141\167\153"] = 'application/x-awk';
520                        $mime_magic[0][12]["\43\41\40\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
521                        $mime_magic[0][12]["\43\41\40\57\142\151\156\57\164\143\163\150"] = 'application/x-csh';
522                        $mime_magic[0][11]["\43\41\11\57\142\151\156\57\141\167\153"] = 'application/x-awk';
523                        $mime_magic[0][11]["\43\41\11\57\142\151\156\57\143\163\150"] = 'application/x-csh';
524                        $mime_magic[0][11]["\43\41\11\57\142\151\156\57\153\163\150"] = 'application/x-ksh';
525                        $mime_magic[0][11]["\43\41\40\57\142\151\156\57\141\167\153"] = 'application/x-awk';
526                        $mime_magic[0][11]["\43\41\40\57\142\151\156\57\143\163\150"] = 'application/x-csh';
527                        $mime_magic[0][11]["\43\41\40\57\142\151\156\57\153\163\150"] = 'application/x-ksh';
528                        $mime_magic[0][11]["\43\41\57\142\151\156\57\142\141\163\150"] = 'application/x-sh';
529                        $mime_magic[0][11]["\43\41\57\142\151\156\57\147\141\167\153"] = 'application/x-awk';
530                        $mime_magic[0][11]["\43\41\57\142\151\156\57\156\141\167\153"] = 'application/x-awk';
531                        $mime_magic[0][11]["\43\41\57\142\151\156\57\160\145\162\154"] = 'application/x-perl';
532                        $mime_magic[0][11]["\43\41\57\142\151\156\57\164\143\163\150"] = 'application/x-csh';
533                        $mime_magic[0][10]["\102\151\164\155\141\160\146\151\154\145"] = 'image/unknown';
534                        $mime_magic[0][10]["\123\124\101\122\124\106\117\116\124\40"] = 'font/x-bdf';
535                        $mime_magic[0][10]["\43\41\11\57\142\151\156\57\162\143"] = 'text/script';
536                        $mime_magic[0][10]["\43\41\11\57\142\151\156\57\163\150"] = 'application/x-sh';
537                        $mime_magic[0][10]["\43\41\40\57\142\151\156\57\162\143"] = 'text/script';
538                        $mime_magic[0][10]["\43\41\40\57\142\151\156\57\163\150"] = 'application/x-sh';
539                        $mime_magic[0][10]["\43\41\57\142\151\156\57\141\167\153"] = 'application/x-awk';
540                        $mime_magic[0][10]["\43\41\57\142\151\156\57\143\163\150"] = 'application/x-csh';
541                        $mime_magic[0][10]["\43\41\57\142\151\156\57\153\163\150"] = 'application/x-ksh';
542                        $mime_magic[0][10]["\74\115\141\153\145\162\106\151\154\145"] = 'application/x-framemaker';
543                        $mime_magic[0][9]["\122\145\143\145\151\166\145\144\72"] = 'message/rfc822';
544                        $mime_magic[0][9]["\123\164\141\162\164\106\157\156\164"] = 'font/x-sunos-news';
545                        $mime_magic[0][9]["\211\114\132\117\0\15\12\32\12"] = 'application/data';
546                        $mime_magic[0][9]["\43\41\57\142\151\156\57\162\143"] = 'text/script';
547                        $mime_magic[0][9]["\43\41\57\142\151\156\57\163\150"] = 'application/x-sh';
548                        $mime_magic[0][9]["\55\162\157\155\61\146\163\55\60"] = 'application/x-filesystem';
549                        $mime_magic[0][9]["\74\102\157\157\153\106\151\154\145"] = 'application/x-framemaker';
550                        $mime_magic[0][8]["\117\156\154\171\40\151\156\40"] = 'text/x-patch';
551                        $mime_magic[0][8]["\147\151\155\160\40\170\143\146"] = 'application/x-gimp-image';
552                        $mime_magic[0][8]["\155\163\147\143\141\164\60\61"] = 'application/x-locale';
553                        $mime_magic[0][8]["\32\141\162\143\150\151\166\145"] = 'application/data';
554                        $mime_magic[0][8]["\41\74\120\104\106\76\41\156"] = 'application/x-prof';
555                        $mime_magic[0][8]["\74\115\111\106\106\151\154\145"] = 'application/x-framemaker';
556                        $mime_magic[0][7]["\101\162\164\151\143\154\145"] = 'message/news';
557                        $mime_magic[0][7]["\120\103\104\137\117\120\101"] = 'x/x-photo-cd-overfiew-file';
558                        $mime_magic[0][7]["\351\54\1\112\101\115\11"] = 'application/data';
559                        $mime_magic[0][7]["\41\74\141\162\143\150\76"] = 'application/x-ar';
560                        $mime_magic[0][7]["\72\40\163\150\145\154\154"] = 'application/data';
561                        $mime_magic[0][6]["\116\165\106\151\154\145"] = 'application/data';
562                        $mime_magic[0][6]["\116\365\106\351\154\345"] = 'application/data';
563                        $mime_magic[0][6]["\60\67\60\67\60\61"] = 'application/x-cpio';
564                        $mime_magic[0][6]["\60\67\60\67\60\62"] = 'application/x-cpio';
565                        $mime_magic[0][6]["\60\67\60\67\60\67"] = 'application/x-cpio';
566                        $mime_magic[0][6]["\74\115\141\153\145\162"] = 'application/x-framemaker';
567                        $mime_magic[0][6]["\74\124\111\124\114\105"] = 'text/html';
568                        $mime_magic[0][6]["\74\164\151\164\154\145"] = 'text/html';
569                        $mime_magic[0][5]["\0\1\0\0\0"] = 'font/ttf';
570                        $mime_magic[0][5]["\0\4\36\212\200"] = 'application/core';
571                        $mime_magic[0][5]["\102\101\102\131\114"] = 'message/x-gnu-rmail';
572                        $mime_magic[0][5]["\102\105\107\111\116"] = 'application/x-awk';
573                        $mime_magic[0][5]["\103\157\162\145\1"] = 'application/x-executable-file';
574                        $mime_magic[0][5]["\104\61\56\60\15"] = 'font/x-speedo';
575                        $mime_magic[0][5]["\106\162\157\155\72"] = 'message/rfc822';
576                        $mime_magic[0][5]["\115\101\123\137\125"] = 'audio/x-multimate-mod';
577                        $mime_magic[0][5]["\120\117\136\121\140"] = 'text/vnd.ms-word';
578                        $mime_magic[0][5]["\120\141\164\150\72"] = 'message/news';
579                        $mime_magic[0][5]["\130\162\145\146\72"] = 'message/news';
580                        $mime_magic[0][5]["\144\151\146\146\40"] = 'text/x-patch';
581                        $mime_magic[0][5]["\225\64\62\62\336"] = 'application/x-locale';
582                        $mime_magic[0][5]["\336\62\62\64\225"] = 'application/x-locale';
583                        $mime_magic[0][5]["\74\110\105\101\104"] = 'text/html';
584                        $mime_magic[0][5]["\74\110\124\115\114"] = 'text/html';
585                        $mime_magic[0][5]["\74\150\145\141\144"] = 'text/html';
586                        $mime_magic[0][5]["\74\150\164\155\154"] = 'text/html';
587                        $mime_magic[0][5]["\75\74\141\162\76"] = 'application/x-ar';
588                        $mime_magic[0][4]["\0\0\0\314"] = 'application/x-executable-file';
589                        $mime_magic[0][4]["\0\0\0\4"] = 'font/x-snf';
590                        $mime_magic[0][4]["\0\0\1\107"] = 'application/x-object-file';
591                        $mime_magic[0][4]["\0\0\1\113"] = 'application/x-executable-file';
592                        $mime_magic[0][4]["\0\0\1\115"] = 'application/x-executable-file';
593                        $mime_magic[0][4]["\0\0\1\117"] = 'application/x-executable-file';
594                        $mime_magic[0][4]["\0\0\1\201"] = 'application/x-object-file';
595                        $mime_magic[0][4]["\0\0\1\207"] = 'application/data';
596                        $mime_magic[0][4]["\0\0\1\263"] = 'video/mpeg';
597                        $mime_magic[0][4]["\0\0\1\272"] = 'video/mpeg';
598                        $mime_magic[0][4]["\0\0\1\6"] = 'application/x-executable-file';
599                        $mime_magic[0][4]["\0\0\201\154"] = 'application/x-apl-workspace';
600                        $mime_magic[0][4]["\0\0\377\145"] = 'application/x-library-file';
601                        $mime_magic[0][4]["\0\0\377\155"] = 'application/data';
602                        $mime_magic[0][4]["\0\0\3\347"] = 'application/x-library-file';
603                        $mime_magic[0][4]["\0\0\3\363"] = 'application/x-executable-file';
604                        $mime_magic[0][4]["\0\144\163\56"] = 'audio/basic';
605                        $mime_magic[0][4]["\0\1\22\127"] = 'application/core';
606                        $mime_magic[0][4]["\0\22\326\207"] = 'image/x11';
607                        $mime_magic[0][4]["\0\3\233\355"] = 'application/data';
608                        $mime_magic[0][4]["\0\3\233\356"] = 'application/data';
609                        $mime_magic[0][4]["\0\5\26\0"] = 'application/data';
610                        $mime_magic[0][4]["\0\5\26\7"] = 'application/data';
611                        $mime_magic[0][4]["\0\5\61\142"] = 'application/x-db';
612                        $mime_magic[0][4]["\0\6\25\141"] = 'application/x-db';
613                        $mime_magic[0][4]["\103\124\115\106"] = 'audio/x-cmf';
614                        $mime_magic[0][4]["\105\115\117\104"] = 'audio/x-emod';
615                        $mime_magic[0][4]["\106\106\111\114"] = 'font/ttf';
616                        $mime_magic[0][4]["\106\117\116\124"] = 'font/x-vfont';
617                        $mime_magic[0][4]["\107\104\102\115"] = 'application/x-gdbm';
618                        $mime_magic[0][4]["\107\111\106\70"] = 'image/gif';
619                        $mime_magic[0][4]["\10\16\12\17"] = 'application/data';
620                        $mime_magic[0][4]["\110\120\101\113"] = 'application/data';
621                        $mime_magic[0][4]["\111\111\116\61"] = 'image/tiff';
622                        $mime_magic[0][4]["\111\111\52\0"] = 'image/tiff';
623                        $mime_magic[0][4]["\114\104\110\151"] = 'application/data';
624                        $mime_magic[0][4]["\114\127\106\116"] = 'font/type1';
625                        $mime_magic[0][4]["\115\115\0\52"] = 'image/tiff';
626                        $mime_magic[0][4]["\115\117\126\111"] = 'video/x-sgi-movie';
627                        $mime_magic[0][4]["\115\124\150\144"] = 'audio/midi';
628                        $mime_magic[0][4]["\115\247\356\350"] = 'font/x-hp-windows';
629                        $mime_magic[0][4]["\116\124\122\113"] = 'audio/x-multitrack';
630                        $mime_magic[0][4]["\120\113\3\4"] = 'application/zip';
631                        $mime_magic[0][4]["\122\111\106\106"] = 'audio/x-wav';
632                        $mime_magic[0][4]["\122\141\162\41"] = 'application/x-rar';
633                        $mime_magic[0][4]["\123\121\123\110"] = 'application/data';
634                        $mime_magic[0][4]["\124\101\104\123"] = 'application/x-tads-game';
635                        $mime_magic[0][4]["\125\103\62\32"] = 'application/data';
636                        $mime_magic[0][4]["\125\116\60\65"] = 'audio/x-mikmod-uni';
637                        $mime_magic[0][4]["\12\17\10\16"] = 'application/data';
638                        $mime_magic[0][4]["\131\246\152\225"] = 'x/x-image-sun-raster';
639                        $mime_magic[0][4]["\145\377\0\0"] = 'application/x-ar';
640                        $mime_magic[0][4]["\150\163\151\61"] = 'image/x-jpeg-proprietary';
641                        $mime_magic[0][4]["\16\10\17\12"] = 'application/data';
642                        $mime_magic[0][4]["\177\105\114\106"] = 'application/x-executable-file';
643                        $mime_magic[0][4]["\17\12\16\10"] = 'application/data';
644                        $mime_magic[0][4]["\1\130\41\246"] = 'application/core';
645                        $mime_magic[0][4]["\1\146\143\160"] = 'font/x-pcf';
646                        $mime_magic[0][4]["\211\120\116\107"] = 'image/x-png';
647                        $mime_magic[0][4]["\23\127\232\316"] = 'application/x-gdbm';
648                        $mime_magic[0][4]["\23\172\51\104"] = 'font/x-sunos-news';
649                        $mime_magic[0][4]["\23\172\51\107"] = 'font/x-sunos-news';
650                        $mime_magic[0][4]["\23\172\51\120"] = 'font/x-sunos-news';
651                        $mime_magic[0][4]["\23\172\51\121"] = 'font/x-sunos-news';
652                        $mime_magic[0][4]["\24\2\131\31"] = 'font/x-libgrx';
653                        $mime_magic[0][4]["\260\61\63\140"] = 'application/x-bootable';
654                        $mime_magic[0][4]["\2\10\1\10"] = 'application/x-executable-file';
655                        $mime_magic[0][4]["\2\10\1\6"] = 'application/x-executable-file';
656                        $mime_magic[0][4]["\2\10\1\7"] = 'application/x-executable-file';
657                        $mime_magic[0][4]["\2\10\377\145"] = 'application/x-library-file';
658                        $mime_magic[0][4]["\2\12\1\10"] = 'application/x-executable-file';
659                        $mime_magic[0][4]["\2\12\1\7"] = 'application/x-executable-file';
660                        $mime_magic[0][4]["\2\12\377\145"] = 'application/x-library-file';
661                        $mime_magic[0][4]["\2\13\1\10"] = 'application/x-executable-file';
662                        $mime_magic[0][4]["\2\13\1\13"] = 'application/x-executable-file';
663                        $mime_magic[0][4]["\2\13\1\15"] = 'application/x-library-file';
664                        $mime_magic[0][4]["\2\13\1\16"] = 'application/x-library-file';
665                        $mime_magic[0][4]["\2\13\1\6"] = 'application/x-object-file';
666                        $mime_magic[0][4]["\2\13\1\7"] = 'application/x-executable-file';
667                        $mime_magic[0][4]["\2\14\1\10"] = 'application/x-executable-file';
668                        $mime_magic[0][4]["\2\14\1\13"] = 'application/x-executable-file';
669                        $mime_magic[0][4]["\2\14\1\14"] = 'application/x-lisp';
670                        $mime_magic[0][4]["\2\14\1\15"] = 'application/x-library-file';
671                        $mime_magic[0][4]["\2\14\1\16"] = 'application/x-library-file';
672                        $mime_magic[0][4]["\2\14\1\6"] = 'application/x-executable-file';
673                        $mime_magic[0][4]["\2\14\1\7"] = 'application/x-executable-file';
674                        $mime_magic[0][4]["\2\14\377\145"] = 'application/x-library-file';
675                        $mime_magic[0][4]["\2\20\1\10"] = 'application/x-executable-file';
676                        $mime_magic[0][4]["\2\20\1\13"] = 'application/x-executable-file';
677                        $mime_magic[0][4]["\2\20\1\15"] = 'application/x-library-file';
678                        $mime_magic[0][4]["\2\20\1\16"] = 'application/x-library-file';
679                        $mime_magic[0][4]["\2\20\1\6"] = 'application/x-object-file';
680                        $mime_magic[0][4]["\2\20\1\7"] = 'application/x-executable-file';
681                        $mime_magic[0][4]["\2\24\1\10"] = 'application/x-executable-file';
682                        $mime_magic[0][4]["\2\24\1\13"] = 'application/x-executable-file';
683                        $mime_magic[0][4]["\2\24\1\15"] = 'application/x-object-file';
684                        $mime_magic[0][4]["\2\24\1\16"] = 'application/x-library-file';
685                        $mime_magic[0][4]["\2\24\1\6"] = 'application/x-object-file';
686                        $mime_magic[0][4]["\2\24\1\7"] = 'application/x-executable-file';
687                        $mime_magic[0][4]["\361\60\100\273"] = 'image/x-cmu-raster';
688                        $mime_magic[0][4]["\366\366\366\366"] = 'application/x-pc-floppy';
689                        $mime_magic[0][4]["\377\106\117\116"] = 'font/x-dos';
690                        $mime_magic[0][4]["\41\74\141\162"] = 'application/x-ar';
691                        $mime_magic[0][4]["\43\41\11\57"] = 'text/script';
692                        $mime_magic[0][4]["\43\41\40\57"] = 'text/script';
693                        $mime_magic[0][4]["\52\123\124\101"] = 'application/data';
694                        $mime_magic[0][4]["\52\52\52\40"] = 'text/x-patch';
695                        $mime_magic[0][4]["\56\162\141\375"] = 'audio/x-pn-realaudio';
696                        $mime_magic[0][4]["\56\163\156\144"] = 'audio/basic';
697                        $mime_magic[0][4]["\61\143\167\40"] = 'application/data';
698                        $mime_magic[0][4]["\61\276\0\0"] = 'text/vnd.ms-word';
699                        $mime_magic[0][4]["\62\62\67\70"] = 'application/data';
700                        $mime_magic[0][4]["\74\115\115\114"] = 'application/x-framemaker';
701                        $mime_magic[0][4]["\74\141\162\76"] = 'application/x-ar';
702                        $mime_magic[0][3]["\102\132\150"] = 'application/x-bzip2';
703                        $mime_magic[0][3]["\106\101\122"] = 'audio/mod';
704                        $mime_magic[0][3]["\115\124\115"] = 'audio/x-multitrack';
705                        $mime_magic[0][3]["\123\102\111"] = 'audio/x-sbi';
706                        $mime_magic[0][3]["\124\117\103"] = 'audio/x-toc';
707                        $mime_magic[0][3]["\12\107\114"] = 'application/data';
708                        $mime_magic[0][3]["\146\154\143"] = 'application/x-font';
709                        $mime_magic[0][3]["\146\154\146"] = 'font/x-figlet';
710                        $mime_magic[0][3]["\33\105\33"] = 'image/x-pcl-hp';
711                        $mime_magic[0][3]["\33\143\33"] = 'application/data';
712                        $mime_magic[0][3]["\377\377\174"] = 'application/data';
713                        $mime_magic[0][3]["\377\377\176"] = 'application/data';
714                        $mime_magic[0][3]["\377\377\177"] = 'application/data';
715                        $mime_magic[0][3]["\43\41\40"] = 'text/script';
716                        $mime_magic[0][3]["\43\41\57"] = 'text/script';
717                        $mime_magic[0][3]["\4\45\41"] = 'application/postscript';
718                        $mime_magic[0][3]["\55\150\55"] = 'application/data';
719                        $mime_magic[0][3]["\61\143\167"] = 'application/data';
720                        $mime_magic[0][2]["\0\0"] = 'application/x-executable-file';
721                        $mime_magic[0][2]["\102\115"] = 'image/x-bmp';
722                        $mime_magic[0][2]["\102\132"] = 'application/x-bzip';
723                        $mime_magic[0][2]["\111\103"] = 'image/x-ico';
724                        $mime_magic[0][2]["\112\116"] = 'audio/x-669-mod';
725                        $mime_magic[0][2]["\115\132"] = 'application/x-ms-dos-executable';
726                        $mime_magic[0][2]["\120\61"] = 'image/x-portable-bitmap';
727                        $mime_magic[0][2]["\120\62"] = 'image/x-portable-graymap';
728                        $mime_magic[0][2]["\120\63"] = 'image/x-portable-pixmap';
729                        $mime_magic[0][2]["\120\64"] = 'image/x-portable-bitmap';
730                        $mime_magic[0][2]["\120\65"] = 'image/x-portable-graymap';
731                        $mime_magic[0][2]["\120\66"] = 'image/x-portable-pixmap';
732                        $mime_magic[0][2]["\151\146"] = 'audio/x-669-mod';
733                        $mime_magic[0][2]["\161\307"] = 'application/x-cpio';
734                        $mime_magic[0][2]["\166\377"] = 'application/data';
735                        $mime_magic[0][2]["\1\110"] = 'application/x-executable-file';
736                        $mime_magic[0][2]["\1\111"] = 'application/x-executable-file';
737                        $mime_magic[0][2]["\1\124"] = 'application/data';
738                        $mime_magic[0][2]["\1\125"] = 'application/x-executable-file';
739                        $mime_magic[0][2]["\1\160"] = 'application/x-executable-file';
740                        $mime_magic[0][2]["\1\161"] = 'application/x-executable-file';
741                        $mime_magic[0][2]["\1\175"] = 'application/x-executable-file';
742                        $mime_magic[0][2]["\1\177"] = 'application/x-executable-file';
743                        $mime_magic[0][2]["\1\20"] = 'application/x-executable-file';
744                        $mime_magic[0][2]["\1\203"] = 'application/x-executable-file';
745                        $mime_magic[0][2]["\1\21"] = 'application/x-executable-file';
746                        $mime_magic[0][2]["\1\210"] = 'application/x-executable-file';
747                        $mime_magic[0][2]["\1\217"] = 'application/x-object-file';
748                        $mime_magic[0][2]["\1\224"] = 'application/x-executable-file';
749                        $mime_magic[0][2]["\1\227"] = 'application/x-executable-file';
750                        $mime_magic[0][2]["\1\332"] = 'x/x-image-sgi';
751                        $mime_magic[0][2]["\1\36"] = 'font/x-vfont';
752                        $mime_magic[0][2]["\1\6"] = 'application/x-executable-file';
753                        $mime_magic[0][2]["\307\161"] = 'application/x-bcpio';
754                        $mime_magic[0][2]["\313\5"] = 'application/data';
755                        $mime_magic[0][2]["\352\140"] = 'application/x-arj';
756                        $mime_magic[0][2]["\367\131"] = 'font/x-tex';
757                        $mime_magic[0][2]["\367\203"] = 'font/x-tex';
758                        $mime_magic[0][2]["\367\312"] = 'font/x-tex';
759                        $mime_magic[0][2]["\36\1"] = 'font/x-vfont';
760                        $mime_magic[0][2]["\375\166"] = 'application/x-lzh';
761                        $mime_magic[0][2]["\376\166"] = 'application/data';
762                        $mime_magic[0][2]["\377\145"] = 'application/data';
763                        $mime_magic[0][2]["\377\155"] = 'application/data';
764                        $mime_magic[0][2]["\377\166"] = 'application/data';
765                        $mime_magic[0][2]["\377\330"] = 'image/jpeg';
766                        $mime_magic[0][2]["\377\37"] = 'application/data';
767                        $mime_magic[0][2]["\37\213"] = 'application/x-gzip';
768                        $mime_magic[0][2]["\37\235"] = 'application/compress';
769                        $mime_magic[0][2]["\37\236"] = 'application/data';
770                        $mime_magic[0][2]["\37\237"] = 'application/data';
771                        $mime_magic[0][2]["\37\240"] = 'application/data';
772                        $mime_magic[0][2]["\37\36"] = 'application/data';
773                        $mime_magic[0][2]["\37\37"] = 'application/data';
774                        $mime_magic[0][2]["\37\377"] = 'application/data';
775                        $mime_magic[0][2]["\45\41"] = 'application/postscript';
776                        $mime_magic[0][2]["\4\66"] = 'font/linux-psf';
777                        $mime_magic[0][2]["\57\57"] = 'text/cpp';
778                        $mime_magic[0][2]["\5\1"] = 'application/x-locale';
779                        $mime_magic[0][2]["\6\1"] = 'application/x-executable-file';
780                        $mime_magic[0][2]["\6\2"] = 'application/x-alan-adventure-game';
781                        $mime_magic[0][2]["\7\1"] = 'application/x-executable-file';
782                        $mime_magic[1][3]["\120\116\107"] = 'image/x-png';
783                        $mime_magic[1][3]["\127\120\103"] = 'text/vnd.wordperfect';
784                        $mime_magic[2][6]["\55\154\150\64\60\55"] = 'application/x-lha';
785                        $mime_magic[2][5]["\55\154\150\144\55"] = 'application/x-lha';
786                        $mime_magic[2][5]["\55\154\150\60\55"] = 'application/x-lha';
787                        $mime_magic[2][5]["\55\154\150\61\55"] = 'application/x-lha';
788                        $mime_magic[2][5]["\55\154\150\62\55"] = 'application/x-lha';
789                        $mime_magic[2][5]["\55\154\150\63\55"] = 'application/x-lha';
790                        $mime_magic[2][5]["\55\154\150\64\55"] = 'application/x-lha';
791                        $mime_magic[2][5]["\55\154\150\65\55"] = 'application/x-lha';
792                        $mime_magic[2][5]["\55\154\172\163\55"] = 'application/x-lha';
793                        $mime_magic[2][5]["\55\154\172\64\55"] = 'application/x-lha';
794                        $mime_magic[2][5]["\55\154\172\65\55"] = 'application/x-lha';
795                        $mime_magic[2][2]["\0\21"] = 'font/x-tex-tfm';
796                        $mime_magic[2][2]["\0\22"] = 'font/x-tex-tfm';
797                        $mime_magic[4][4]["\155\144\141\164"] = 'video/quicktime';
798                        $mime_magic[4][4]["\155\157\157\166"] = 'video/quicktime';
799                        $mime_magic[4][4]["\160\151\160\145"] = 'application/data';
800                        $mime_magic[4][4]["\160\162\157\146"] = 'application/data';
801                        $mime_magic[4][2]["\257\21"] = 'video/fli';
802                        $mime_magic[4][2]["\257\22"] = 'video/flc';
803                        $mime_magic[6][18]["\45\41\120\123\55\101\144\157\142\145\106\157\156\164\55\61\56\60"] = 'font/type1';
804                        $mime_magic[7][22]["\357\20\60\60\60\60\60\60\60\60\60\60\60\60\60\60\60\60\60\60\60\60"] = 'application/core';
805                        $mime_magic[7][4]["\0\105\107\101"] = 'font/x-dos';
806                        $mime_magic[7][4]["\0\126\111\104"] = 'font/x-dos';
807                        $mime_magic[8][4]["\23\172\53\105"] = 'font/x-sunos-news';
808                        $mime_magic[8][4]["\23\172\53\110"] = 'font/x-sunos-news';
809                        $mime_magic[10][25]["\43\40\124\150\151\163\40\151\163\40\141\40\163\150\145\154\154\40\141\162\143\150\151\166\145"] = 'application/x-shar';
810                        $mime_magic[20][4]["\107\111\115\120"] = 'application/x-gimp-brush';
811                        $mime_magic[20][4]["\107\120\101\124"] = 'application/x-gimp-pattern';
812                        $mime_magic[20][4]["\375\304\247\334"] = 'application/x-zoo';
813                        $mime_magic[21][8]["\41\123\103\122\105\101\115\41"] = 'audio/x-st2-mod';
814                        $mime_magic[24][4]["\0\0\352\153"] = 'application/x-dump';
815                        $mime_magic[24][4]["\0\0\352\154"] = 'application/x-dump';
816                        $mime_magic[24][4]["\0\0\352\155"] = 'application/data';
817                        $mime_magic[24][4]["\0\0\352\156"] = 'application/data';
818                        $mime_magic[65][4]["\106\106\111\114"] = 'font/ttf';
819                        $mime_magic[65][4]["\114\127\106\116"] = 'font/type1';
820                        $mime_magic[257][8]["\165\163\164\141\162\40\40\60"] = 'application/x-gtar';
821                        $mime_magic[257][6]["\165\163\164\141\162\60"] = 'application/x-tar';
822                        $mime_magic[0774][2]["\332\276"] = 'application/data';
823                        $mime_magic[1080][4]["\103\104\70\61"] = 'audio/x-oktalyzer-mod';
824                        $mime_magic[1080][4]["\106\114\124\64"] = 'audio/x-startracker-mod';
825                        $mime_magic[1080][4]["\115\41\113\41"] = 'audio/x-protracker-mod';
826                        $mime_magic[1080][4]["\115\56\113\56"] = 'audio/x-protracker-mod';
827                        $mime_magic[1080][4]["\117\113\124\101"] = 'audio/x-oktalyzer-mod';
828                        $mime_magic[1080][4]["\61\66\103\116"] = 'audio/x-taketracker-mod';
829                        $mime_magic[1080][4]["\63\62\103\116"] = 'audio/x-taketracker-mod';
830                        $mime_magic[1080][4]["\64\103\110\116"] = 'audio/x-fasttracker-mod';
831                        $mime_magic[1080][4]["\66\103\110\116"] = 'audio/x-fasttracker-mod';
832                        $mime_magic[1080][4]["\70\103\110\116"] = 'audio/x-fasttracker-mod';
833                        $mime_magic[2048][7]["\120\103\104\137\111\120\111"] = 'x/x-photo-cd-pack-file';
834                        $mime_magic[2080][29]["\115\151\143\162\157\163\157\146\164\40\105\170\143\145\154\40\65\56\60\40\127\157\162\153\163\150\145\145\164"] = 'application/vnd.ms-excel';
835                        $mime_magic[2080][27]["\115\151\143\162\157\163\157\146\164\40\127\157\162\144\40\66\56\60\40\104\157\143\165\155\145\156\164"] = 'text/vnd.ms-word';
836                        $mime_magic[2080][26]["\104\157\143\165\155\145\156\164\157\40\115\151\143\162\157\163\157\146\164\40\127\157\162\144\40\66"] = 'text/vnd.ms-word';
837                        $mime_magic[2112][9]["\115\123\127\157\162\144\104\157\143"] = 'text/vnd.ms-word';
838                        $mime_magic[2114][5]["\102\151\146\146\65"] = 'application/vnd.ms-excel';
839                        $mime_magic[4098][7]["\104\117\123\106\117\116\124"] = 'font/x-dos';
840                        $mime_magic[68158480][2]["\23\177"] = 'application/x-filesystem';
841                        $mime_magic[68158480][2]["\23\217"] = 'application/x-filesystem';
842                        $mime_magic[68158480][2]["\44\150"] = 'application/x-filesystem';
843                        $mime_magic[68158480][2]["\44\170"] = 'application/x-filesystem';
844                        $mime_magic[70779960][2]["\357\123"] = 'application/x-linux-ext2fs';
845
846                        return $mime_magic;
847                }
848        }
849?>
Note: See TracBrowser for help on using the repository browser.