- /**
- * Get MIME type type of file
- * @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 ',
- ' avi ' = ' 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-director ',
- ' dif ' = ' video/x-dv ',
- ' dir ' = ' application/x-director ',
- ' 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-director ',
- ' 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 ',
- ' IGEs ' = ' model/iges ',
- ' IGs ' = ' 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 ',
- ' M4V ' = ' video/x-m4v ',
- ' Mac ' = ' Image/x-macpaint ',
- ' Man ' = ' Application/x-troff-man ',
- ' MathML ' = ' application/mathml+xml ',
- ' Me ' = ' application/x-troff-me ',
- ' Mesh ' = ' model/mesh ',
- ' Mid ' = ' Audio/midi ',
- ' midi ' = ' Audio/midi ',
- ' MIF ' = ' application/vnd.mif ',
- ' mov ' = ' video/quicktime ',
- ' Movie ' = ' Video/x-sgi-movie ',
- ' 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 ',
- ' Ogg ' = ' application/ogg ',
- ' 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-macpaint ',
- ' Pntg ' = ' image/x-macpaint ',
- ' ppm ' = ' image/x-portable-pixmap ',
- ' ppt ' = ' application/vnd.ms-powerpoint ',
- ' ps ' = ' application/postscript ',
- ' qt ' = ' video/quicktime ',
- ' Qti ' = ' image/x-quicktime ',
- ' Qtif ' = ' image/x-quicktime ',
- ' ra ' = ' 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 ',
- ' Texi ' = ' application/x-texinfo ',
- ' Texinfo ' = ' application/x-texinfo ',
- ' 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 ',
- ' VRML ' = ' model/vrml ',
- ' 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/vrml ',
- ' 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 ');
- }
- }
Copy Code
|