인터넷정보

mime type 알아오기

알 수 없는 사용자 2007. 10. 11. 16:56
function get_mine_type($exp){
$exp = strtolower($exp);
static $mime_type;
if(!is_array($mime_type)){
$mime_type = array();
$mime_type['dwg']='application/acad';
$mime_type['ccad']='application/clariscad';
$mime_type['dxf']='application/dxf';
$mime_type['mdb']='application/msaccess';
$mime_type['doc']='application/msword';
$mime_type['bin']='application/octet-stream';
$mime_type['pdf']='application/pdf';
$mime_type['ai']='application/postscript';
$mime_type['ps']='application/postscript';
$mime_type['eps']='application/postscript';
$mime_type['rtf']='application/rtf';
$mime_type['rtf']='application/rtf';
$mime_type['xls']='application/vnd.ms-excel';
$mime_type['ppt']='application/vnd.ms-powerpoint';
$mime_type['cdf']='application/x-cdf';
$mime_type['csh']='application/x-csh';
$mime_type['csh']='application/x-csh';
$mime_type['dvi']='application/x-dvi';
$mime_type['js']='application/x-javascript';
$mime_type['latex']='application/x-latex';
$mime_type['mif']='application/x-mif';
$mime_type['xls']='application/x-msexcel';
$mime_type['ppt']='application/x-mspowerpoint';
$mime_type['tcl']='application/x-tcl';
$mime_type['tex']='application/x-tex';
$mime_type['texinfo']='application/x-texinfo';
$mime_type['texi']='application/x-texinfo';
$mime_type['t']='application/x-troff';
$mime_type['tr']='application/x-troff';
$mime_type['roff']='application/x-troff';
$mime_type['man']='application/x-troff-man';
$mime_type['me']='application/x-troff-me';
$mime_type['ms']='application/x-troff-ms';
$mime_type['src']='application/x-wais-source';
$mime_type['zip']='application/zip';
$mime_type['au']='audio/basic';
$mime_type['snd']='audio/basic';
$mime_type['aif']='audio/x-aiff';
$mime_type['aiff']='audio/x-aiff';
$mime_type['aifc']='audio/x-aiff';
$mime_type['wav']='audio/x-wav';
$mime_type['gif']='image/gif';
$mime_type['ief']='image/ief';
$mime_type['jpeg']='image/jpeg';
$mime_type['jpg']='image/jpeg';
$mime_type['jpe']='image/jpeg';
$mime_type['tiff']='image/tiff';
$mime_type['tif']='image/tiff';
$mime_type['png']='image/png';
$mime_type['ras']='image/x-cmu-raster';
$mime_type['pnm']='image/x-portable-anymap';
$mime_type['pbm']='image/x-portable-bitmap';
$mime_type['pgm']='image/x-portable-graymap';
$mime_type['ppm']='image/x-portable-pixmap';
$mime_type['rgb']='image/x-rgb';
$mime_type['xbm']='image/x-xbitmap';
$mime_type['xpm']='image/x-xpixmap';
$mime_type['xwd']='image/x-xwindowdump';
$mime_type['gzip']='multipart/x-gzip';
$mime_type['zip']='multipart/x-zip';
$mime_type['css']='text/css';
$mime_type['html']='text/html';
$mime_type['htm']='text/html';
$mime_type['txt']='text/plain';
$mime_type['rtx']='text/richtext';
$mime_type['tsv']='text/tab-separated-values';
$mime_type['xml']='text/xml';
$mime_type['etx']='text/x-setext';
$mime_type['xsl']='text/xsl';
$mime_type['mpeg']='video/mpeg';
$mime_type['mpg']='video/mpeg';
$mime_type['mpe']='video/mpeg';
$mime_type['mov']='video/quicktime';
$mime_type['qt']='video/quicktime';
$mime_type['avi']='video/x-msvideo';
$mime_type['movie']='video/x-sgi-movie';
$mime_type['swf']='application/x-shockwave-flash';
}
if(isset($mime_type[$exp])){
return $mime_type[$exp] ;
}else{
return false;
}
}
반응형