⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mimelist.php

📁 太烦了
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Retrieve the MIME of a file thanks to its extension
 *
 * PHP versions 4 and 5
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA
 *
 * @category   File Formats
 * @package    File_Archive
 * @author     Vincent Lascaux <vincentlascaux@php.net>
 * @copyright  1997-2005 The PHP Group
 * @license    http://www.gnu.org/copyleft/lesser.html  LGPL
 * @version    CVS: $Id: MimeList.php,v 1.1 2006/07/15 21:31:47 cvs Exp $
 * @link       http://pear.php.net/package/File_Archive
 */

/**
 * Returns the MIME of the filename, deducted from its extension
 * If the extension is unknown, returns "application/octet-stream"
 */
function File_Archive_Reader_GetMime($filename)
{
    $pos = strrpos($filename, '.');
    $extension = "";
    if ($pos !== false) {
        $extension = strtolower(substr($filename, $pos+1));
    }

    switch($extension) {
    case '3dmf':
        return 'x-world/x-3dmf';
    case 'a':
        return 'application/octet-stream';
    case 'aab':
        return 'application/x-authorware-bin';
    case 'aam':
        return 'application/x-authorware-map';
    case 'aas':
        return 'application/x-authorware-seg';
    case 'abc':
        return 'text/vnd.abc';
    case 'acgi':
        return 'text/html';
    case 'afl':
        return 'video/animaflex';
    case 'ai':
        return 'application/postscript';
    case 'aif':
        return 'audio/aiff';
    case 'aifc':
        return 'audio/aiff';
    case 'aiff':
        return 'audio/aiff';
    case 'aim':
        return 'application/x-aim';
    case 'aip':
        return 'text/x-audiosoft-intra';
    case 'ani':
        return 'application/x-navi-animation';
    case 'aos':
        return 'application/x-nokia-9000-communicator-add-on-software';
    case 'aps':
        return 'application/mime';
    case 'arc':
        return 'application/octet-stream';
    case 'arj':
        return 'application/arj';
    case 'art':
        return 'image/x-jg';
    case 'asf':
        return 'video/x-ms-asf';
    case 'asm':
        return 'text/x-asm';
    case 'asp':
        return 'text/asp';
    case 'asx':
        return 'application/x-mplayer2';
    case 'au':
        return 'audio/basic';
    case 'avi':
        return 'application/x-troff-msvideo';
    case 'avs':
        return 'video/avs-video';
    case 'bcpio':
        return 'application/x-bcpio';
    case 'bin':
        return 'application/x-binary';
    case 'bm':
        return 'image/bmp';
    case 'bmp':
        return 'image/bmp';
    case 'boo':
        return 'application/book';
    case 'book':
        return 'application/book';
    case 'boz':
        return 'application/x-bzip2';
    case 'bsh':
        return 'application/x-bsh';
    case 'bz':
        return 'application/x-bzip';
    case 'bz2':
        return 'application/x-bzip2';
    case 'c':
        return 'text/plain';
    case 'c++':
        return 'text/plain';
    case 'cat':
        return 'application/vnd.ms-pki.seccat';
    case 'cc':
        return 'text/plain';
    case 'ccad':
        return 'application/clariscad';
    case 'cco':
        return 'application/x-cocoa';
    case 'cdf':
        return 'application/cdf';
    case 'cer':
        return 'application/pkix-cert';
    case 'cha':
        return 'application/x-chat';
    case 'chat':
        return 'application/x-chat';
    case 'class':
        return 'application/java';
    case 'com':
        return 'application/octet-stream';
    case 'conf':
        return 'text/plain';
    case 'cpio':
        return 'application/x-cpio';
    case 'cpp':
        return 'text/x-c';
    case 'cpt':
        return 'application/mac-compactpro';
    case 'crl':
        return 'application/pkcs-crl';
    case 'csh':
        return 'application/x-csh';
    case 'css':
        return 'text/css';
    case 'cxx':
        return 'text/plain';
    case 'dcr':
        return 'application/x-director';
    case 'deepv':
        return 'application/x-deepv';
    case 'def':
        return 'text/plain';
    case 'der':
        return 'application/x-x509-ca-cert';
    case 'dif':
        return 'video/x-dv';
    case 'dir':
        return 'application/x-director';
    case 'dl':
        return 'video/dl';
    case 'doc':
        return 'application/msword';
    case 'dot':
        return 'application/msword';
    case 'dp':
        return 'application/commonground';
    case 'drw':
        return 'application/drafting';
    case 'dump':
        return 'application/octet-stream';
    case 'dv':
        return 'video/x-dv';
    case 'dvi':
        return 'application/x-dvi';
    case 'dwf':
        return 'drawing/x-dwf (old)';
    case 'dwg':
        return 'application/acad';
    case 'dxf':
        return 'application/dxf';
    case 'dxr':
        return 'application/x-director';
    case 'el':
        return 'text/x-script.elisp';
    case 'elc':
        return 'application/x-bytecode.elisp (compiled elisp)';
    case 'env':
        return 'application/x-envoy';
    case 'eps':
        return 'application/postscript';
    case 'es':
        return 'application/x-esrehber';
    case 'etx':
        return 'text/x-setext';
    case 'evy':
        return 'application/envoy';
    case 'exe':
        return 'application/octet-stream';
    case 'f':
        return 'text/plain';
    case 'f77':
        return 'text/x-fortran';
    case 'f90':
        return 'text/plain';
    case 'fdf':
        return 'application/vnd.fdf';
    case 'fif':
        return 'application/fractals';
    case 'fli':
        return 'video/fli';
    case 'flo':
        return 'image/florian';
    case 'flx':
        return 'text/vnd.fmi.flexstor';
    case 'fmf':
        return 'video/x-atomic3d-feature';
    case 'for':
        return 'text/plain';
    case 'fpx':
        return 'image/vnd.fpx';
    case 'frl':
        return 'application/freeloader';
    case 'funk':
        return 'audio/make';
    case 'g':
        return 'text/plain';
    case 'g3':
        return 'image/g3fax';
    case 'gif':
        return 'image/gif';
    case 'gl':
        return 'video/gl';
    case 'gsd':
        return 'audio/x-gsm';
    case 'gsm':
        return 'audio/x-gsm';
    case 'gsp':
        return 'application/x-gsp';
    case 'gss':
        return 'application/x-gss';
    case 'gtar':
        return 'application/x-gtar';
    case 'gz':
        return 'application/x-compressed';
    case 'gzip':
        return 'application/x-gzip';
    case 'h':
        return 'text/plain';
    case 'hdf':
        return 'application/x-hdf';
    case 'help':
        return 'application/x-helpfile';
    case 'hgl':
        return 'application/vnd.hp-hpgl';
    case 'hh':
        return 'text/plain';
    case 'hlb':
        return 'text/x-script';
    case 'hlp':
        return 'application/hlp';
    case 'hpg':
        return 'application/vnd.hp-hpgl';
    case 'hpgl':
        return 'application/vnd.hp-hpgl';
    case 'hqx':
        return 'application/binhex';
    case 'hta':
        return 'application/hta';
    case 'htc':
        return 'text/x-component';
    case 'htm':
        return 'text/html';
    case 'html':
        return 'text/html';
    case 'htmls':
        return 'text/html';
    case 'htt':
        return 'text/webviewhtml';
    case 'htx':
        return 'text/html';
    case 'ice':
        return 'x-conference/x-cooltalk';
    case 'ico':
        return 'image/x-icon';
    case 'idc':
        return 'text/plain';
    case 'ief':
        return 'image/ief';
    case 'iefs':
        return 'image/ief';
    case 'iges':
        return 'application/iges';
    case 'igs':
        return 'application/iges';
    case 'ima':
        return 'application/x-ima';
    case 'imap':
        return 'application/x-httpd-imap';
    case 'inf':
        return 'application/inf';
    case 'ins':
        return 'application/x-internett-signup';
    case 'ip':
        return 'application/x-ip2';
    case 'isu':
        return 'video/x-isvideo';
    case 'it':
        return 'audio/it';
    case 'iv':
        return 'application/x-inventor';
    case 'ivr':
        return 'i-world/i-vrml';
    case 'ivy':
        return 'application/x-livescreen';
    case 'jam':
        return 'audio/x-jam';
    case 'jav':
        return 'text/plain';
    case 'java':
        return 'text/plain';
    case 'jcm':
        return 'application/x-java-commerce';
    case 'jfif':
        return 'image/jpeg';
    case 'jfif-tbnl':
        return 'image/jpeg';
    case 'jpe':
        return 'image/jpeg';
    case 'jpeg':
        return 'image/jpeg';
    case 'jpg':
        return 'image/jpeg';
    case 'jps':
        return 'image/x-jps';
    case 'js':
        return 'application/x-javascript';
    case 'jut':
        return 'image/jutvision';
    case 'kar':
        return 'audio/midi';
    case 'ksh':
        return 'application/x-ksh';
    case 'la':
        return 'audio/nspaudio';
    case 'lam':
        return 'audio/x-liveaudio';
    case 'latex':
        return 'application/x-latex';
    case 'lha':
        return 'application/lha';
    case 'lhx':
        return 'application/octet-stream';
    case 'list':
        return 'text/plain';
    case 'lma':
        return 'audio/nspaudio';
    case 'log':
        return 'text/plain';
    case 'lsp':
        return 'application/x-lisp';
    case 'lst':
        return 'text/plain';
    case 'lsx':
        return 'text/x-la-asf';
    case 'ltx':
        return 'application/x-latex';
    case 'lzh':
        return 'application/octet-stream';
    case 'lzx':
        return 'application/lzx';
    case 'm':
        return 'text/plain';
    case 'm1v':
        return 'video/mpeg';
    case 'm2a':
        return 'audio/mpeg';
    case 'm2v':
        return 'video/mpeg';
    case 'm3u':
        return 'audio/x-mpequrl';
    case 'man':
        return 'application/x-troff-man';
    case 'map':
        return 'application/x-navimap';
    case 'mar':
        return 'text/plain';
    case 'mbd':
        return 'application/mbedlet';
    case 'mc$':
        return 'application/x-magic-cap-package-1.0';
    case 'mcd':
        return 'application/mcad';
    case 'mcf':
        return 'image/vasa';
    case 'mcp':
        return 'application/netmc';
    case 'me':
        return 'application/x-troff-me';
    case 'mht':
        return 'message/rfc822';
    case 'mhtml':
        return 'message/rfc822';
    case 'mid':
        return 'application/x-midi';
    case 'midi':
        return 'audio/midi';
    case 'mif':
        return 'application/x-frame';
    case 'mime':
        return 'message/rfc822';
    case 'mjf':
        return 'audio/x-vnd.audioexplosion.mjuicemediafile';
    case 'mjpg':
        return 'video/x-motion-jpeg';
    case 'mm':
        return 'application/base64';
    case 'mme':
        return 'application/base64';
    case 'mod':
        return 'audio/mod';
    case 'moov':
        return 'video/quicktime';
    case 'mov':
        return 'video/quicktime';
    case 'movie':
        return 'video/x-sgi-movie';
    case 'mp2':
        return 'video/mpeg';
    case 'mp3':
        return 'video/mpeg';
    case 'mpa':
        return 'audio/mpeg';
    case 'mpc':
        return 'application/x-project';
    case 'mpe':
        return 'video/mpeg';
    case 'mpeg':
        return 'video/mpeg';
    case 'mpg':
        return 'video/mpeg';
    case 'mpga':
        return 'audio/mpeg';
    case 'mpp':
        return 'application/vnd.ms-project';
    case 'mpt':
        return 'application/x-project';
    case 'mpv':
        return 'application/x-project';
    case 'mpx':
        return 'application/x-project';
    case 'mrc':
        return 'application/marc';
    case 'ms':
        return 'application/x-troff-ms';
    case 'mv':
        return 'video/x-sgi-movie';
    case 'my':
        return 'audio/make';

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -