- /**
- * Obtain the mime type of the object.
- * @ Author xiaobing. meng
- *
- */
- Class MimeTypes {
- Public static $ mime_types = array (
- 'Apk '=> 'application/vnd. android. package-archive ',
- '3gp '=> 'video/3gpp ',
- 'AI' => 'application/postscript ',
- 'Aif' => 'audio/x-aiff ',
- 'Aifc '=> 'audio/x-aiff ',
- 'Aiff '=> 'audio/x-aiff ',
- 'Asc '=> 'text/plain ',
- 'Atom '=> 'application/atom + XML ',
- 'Au '=> 'audio/basic ',
- 'Av' => 'video/x-msvideo ',
- 'Bcpio' => 'application/x-bcpio ',
- 'Bin' => 'application/octet-stream ',
- 'Bmp '=> 'image/bmp ',
- 'Cdf' => 'application/x-netcdf ',
- 'Cgm '=> 'image/cgm ',
- 'Class' => 'application/octet-stream ',
- 'Cpio' => 'application/x-cpio ',
- 'Cpt' => 'application/mac-compactpro ',
- 'CSH' => 'application/x-csh ',
- 'Css '=> 'text/css ',
- 'Dcr '=> 'application/x-ctor ',
- 'Dif '=> 'video/x-dv ',
- 'Dir' => 'application/x-ctor ',
- 'Djv' => 'image/vnd. djvu ',
- 'Djvu '=> 'image/vnd. djvu ',
- 'Dll '=> 'application/octet-stream ',
- 'Dmg '=> 'application/octet-stream ',
- 'Dms '=> 'application/octet-stream ',
- 'Doc' => 'application/msword ',
- 'Dtd '=> 'application/xml-dtd ',
- 'Dv' => 'video/x-dv ',
- 'Dvi '=> 'application/x-dvi ',
- 'Dxr' => 'application/x-ctor ',
- 'Eps '=> 'application/postscript ',
- 'Etx' => 'text/x-setext ',
- 'Exe '=> 'application/octet-stream ',
- 'EZ '=> 'application/andrew-inset ',
- 'Flv' => 'video/x-flv ',
- 'Gif' => 'image/GIF ',
- 'Gram '=> 'application/srgs ',
- 'Grxml' => 'application/srgs + XML ',
- 'Gtar '=> 'application/x-gtar ',
- 'Gz '=> 'application/x-gzip ',
- 'Hdf' => 'application/x-hdf ',
- 'Hqx' => 'application/mac-binhex40 ',
- 'Htm '=> 'text/html ',
- 'Html' => 'text/html ',
- 'Ice '=> 'X-conference/x-cooltalk ',
- 'Ico '=> 'image/x-icon ',
- 'Ics '=> 'text/calendar ',
- 'Ief' => 'image/ief ',
- 'Ifb' => 'text/calendar ',
- & Apos; iges & apos; = & apos; model/iges & apos ',
- 'Gies' => 'model/iges ',
- 'Jnlp '=> 'application/x-java-jnlp-file ',
- 'Jp2' => 'image/jp2 ',
- 'Jpe' => 'image/jpeg ',
- 'Jpeg '=> 'image/jpeg ',
- 'Jpg '=> 'image/jpeg ',
- 'Js' => 'application/x-javascript ',
- 'Kar '=> 'audio/midi ',
- 'Latex '=> 'application/x-latex ',
- 'Lha' => 'application/octet-stream ',
- 'Lzh '=> 'application/octet-stream ',
- 'M3u' => 'audio/x-mpegurl ',
- 'M4a '=> 'audio/mp4a-latm ',
- 'M4p' => 'audio/mp4a-latm ',
- 'M4u' => 'video/vnd. mpegurl ',
- 'M4' => 'video/x-m4v ',
- 'Mac' => 'image/x-macpa ',
- 'Man '=> 'application/x-troff-man ',
- 'Mathm' => 'application/mathml + XML ',
- 'Me' => 'application/x-troff-me ',
- 'Mesh '=> 'model/mesh ',
- 'Mid '=> 'audio/midi ',
- 'Midi '=> 'audio/midi ',
- 'Mfa' => 'application/vnd. mfa ',
- 'Mov' => 'video/quicktime ',
- 'Movi' => 'video/x-sgi-Movi ',
- 'Mp2' => 'audio/mpeg ',
- 'Mp3' => 'audio/mpeg ',
- 'MP4' => 'video/mp4 ',
- 'Mpe' => 'video/mpeg ',
- 'MPEG '=> 'video/mpeg ',
- 'Mpg' => 'video/mpeg ',
- 'Mpga' => 'audio/mpeg ',
- 'Ms' => 'application/x-troff-MS ',
- 'Msh' => 'model/mesh ',
- 'Mxu' => 'video/vnd. mpegurl ',
- 'NC '=> 'application/x-netcdf ',
- 'Oda '=> 'application/oda ',
- 'Ogc' => 'application/ogc ',
- 'Ogv' => 'video/ogv ',
- 'Pbm' => 'image/x-portable-bitmap ',
- 'Pct '=> 'image/pict ',
- 'Pdb' => 'chemical/x-pdb ',
- 'PDF '=> 'application/pdf ',
- 'Pgm '=> 'image/x-portable-graymap ',
- 'Pgn' => 'application/x-chess-pgn ',
- 'Pic '=> 'image/pict ',
- 'Pict' => 'image/pict ',
- 'PNG '=> 'image/png ',
- 'Pnm '=> 'image/x-portable-anymap ',
- 'Pnt '=> 'image/x-macpa ',
- 'Png' => 'image/x-macpa ',
- 'Ppm '=> 'image/x-portable-pixmap ',
- 'Ppt '=> 'application/vnd. ms-powerpoint ',
- 'PS '=> 'application/postscript ',
- 'Qt '=> 'video/quicktime ',
- 'Qti' => 'image/x-quicktime ',
- 'Qtif '=> 'image/x-quicktime ',
- 'A' => 'audio/x-pn-realaudio ',
- 'Ram '=> 'audio/x-pn-realaudio ',
- 'Ras '=> 'image/x-cmu-raster ',
- 'Rdf '=> 'application/rdf + XML ',
- 'Rgb '=> 'image/x-rgb ',
- 'Rm '=> 'application/vnd. rn-realmedia ',
- 'Roff' => 'application/x-troff ',
- 'Rtf '=> 'text/rtf ',
- 'Rtx' => 'text/richtext ',
- 'Sgm' => 'text/sgml ',
- 'Sgml' => 'text/sgml ',
- 'Sh' => 'application/x-sh ',
- 'Shar '=> 'application/x-shar ',
- 'Silo' => 'model/mesh ',
- 'Sit '=> 'application/x-stuffit ',
- 'Skd' => 'application/x-koan ',
- 'Skm' => 'application/x-koan ',
- 'Skp' => 'application/x-koan ',
- 'Skt' => 'application/x-koan ',
- 'Smi' => 'application/smil ',
- 'Smil '=> 'application/smil ',
- 'Snd' => 'audio/basic ',
- 'So' => 'application/octet-stream ',
- 'Spl' => 'application/x-futuresplash ',
- 'Src' => 'application/x-wais-source ',
- 'Sv4cpio '=> 'application/x-sv4cpio ',
- 'Sv4crc '=> 'application/x-sv4crc ',
- 'Svg '=> 'image/svg + XML ',
- 'Swf '=> 'application/x-shockwave-Flash ',
- 'T' => 'application/x-troff ',
- 'Tar '=> 'application/x-tar ',
- 'Tcl '=> 'application/x-tcl ',
- 'Tex '=> 'application/x-tex ',
- 'Text' => 'application/x-textinfo ',
- 'Textinfo' => 'application/x-textinfo ',
- 'Tif '=> 'image/tiff ',
- 'Tiff '=> 'image/tiff ',
- 'Tr' => 'application/x-troff ',
- 'Tsv' => 'text/tab-separated-values ',
- 'Txt '=> 'text/plain ',
- 'Ustar' => 'application/x-ustar ',
- 'Vcd' => 'application/x-cdlink ',
- 'Jpa' => 'model/jpa ',
- 'Vxml' => 'application/voicexml + XML ',
- 'Wav '=> 'audio/x-wav ',
- 'Wbmp '=> 'image/vnd. wap. wbmp ',
- 'Wbxml' => 'application/vnd. wap. wbxml ',
- 'Webm' => 'video/webm ',
- 'Wml' => 'text/vnd. wap. wml ',
- 'Wmlc' => 'application/vnd. wap. wmlc ',
- 'Wmls' => 'text/vnd. wap. wmlscript ',
- 'Wmlsc '=> 'application/vnd. wap. wmlscriptc ',
- 'Wmv '=> 'video/x-ms-wmv ',
- 'Wrl' => 'model/jpa ',
- 'Xbm '=> 'image/x-xbitmap ',
- 'Xht '=> 'application/xhtml + XML ',
- 'Xhtml '=> 'application/xhtml + XML ',
- 'XLS '=> 'application/vnd. ms-excel ',
- 'Xml' => 'application/XML ',
- 'Xpm' => 'image/x-xpixmap ',
- 'Xsl '=> 'application/XML ',
- 'Xslt '=> 'application/xslt + XML ',
- 'Xul '=> 'application/vnd. mozilla. xul + XML ',
- 'Xwd '=> 'image/x-xwindowdump ',
- 'XYZ' => 'chemical/x-XYZ ',
- 'Zip' => 'application/zip ');
- Public static function get_mimetype ($ ext ){
- Return (isset (self: $ mime_types [$ ext])? Self: $ mime_types [$ ext]: 'application/octet-stream ');
- }
- }
|