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;
}
}
---------------=------------=-----------------
http_file_manager 속에 있는겁니다.
볼꺼도 없습니다.
파일의 해더 뒤지는 것도 아니고 그냥
확장자를 키로 써서 그에맞는 mime 타입 문자열을 빼오는 겁니다.
ex>
print get_mine_type('avi');
->video/x-msvideo
---------=-----------=---------
저작권이 대세인것 같은데
저작자는 mins(공대여자) 즉, 접니다.
그러니 사용할 때마다 마음속으로
"공대여자 예뼜다."를 향숙이 버전으로 외치고 사용해주세요.
------------------------=------------------------=-----------
아... 타입 더 추가하신 분은 알려주세요.~
----------------------------------------------------------=-----
추가
대소문자 구분없이 전부 소문자로 바꿔서 비교합니다.
swf 추가했어요~
http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=47227&sca=%C7%D4%BC%F6<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:12:10 PHP & HTML에서 이동 됨]</div>
$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;
}
}
---------------=------------=-----------------
http_file_manager 속에 있는겁니다.
볼꺼도 없습니다.
파일의 해더 뒤지는 것도 아니고 그냥
확장자를 키로 써서 그에맞는 mime 타입 문자열을 빼오는 겁니다.
ex>
print get_mine_type('avi');
->video/x-msvideo
---------=-----------=---------
저작권이 대세인것 같은데
저작자는 mins(공대여자) 즉, 접니다.
그러니 사용할 때마다 마음속으로
"공대여자 예뼜다."를 향숙이 버전으로 외치고 사용해주세요.
------------------------=------------------------=-----------
아... 타입 더 추가하신 분은 알려주세요.~
----------------------------------------------------------=-----
추가
대소문자 구분없이 전부 소문자로 바꿔서 비교합니다.
swf 추가했어요~
http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=47227&sca=%C7%D4%BC%F6<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:12:10 PHP & HTML에서 이동 됨]</div>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 530 |
|
19년 전 | 1226 | |
| 529 |
|
19년 전 | 1407 | |
| 528 |
|
19년 전 | 1974 | |
| 527 |
사랑과우정
|
19년 전 | 2385 | |
| 526 | 19년 전 | 2868 | ||
| 525 |
|
19년 전 | 2289 | |
| 524 |
|
19년 전 | 1794 | |
| 523 | 19년 전 | 7030 | ||
| 522 |
|
19년 전 | 3725 | |
| 521 | 19년 전 | 2332 | ||
| 520 | 19년 전 | 2364 | ||
| 519 | 19년 전 | 2858 | ||
| 518 |
|
19년 전 | 5772 | |
| 517 |
|
19년 전 | 5546 | |
| 516 |
|
19년 전 | 2251 | |
| 515 |
|
19년 전 | 3288 | |
| 514 | 19년 전 | 2857 | ||
| 513 | 19년 전 | 2214 | ||
| 512 |
개발자관리자
|
19년 전 | 2726 | |
| 511 |
개발자관리자
|
19년 전 | 1581 | |
| 510 |
개발자관리자
|
19년 전 | 1735 | |
| 509 |
개발자관리자
|
19년 전 | 1831 | |
| 508 |
개발자관리자
|
19년 전 | 2001 | |
| 507 |
개발자관리자
|
19년 전 | 1681 | |
| 506 |
개발자관리자
|
19년 전 | 1801 | |
| 505 |
개발자관리자
|
19년 전 | 1767 | |
| 504 |
개발자관리자
|
19년 전 | 1847 | |
| 503 |
개발자관리자
|
19년 전 | 1520 | |
| 502 |
개발자관리자
|
19년 전 | 2644 | |
| 501 | 19년 전 | 1984 | ||
| 500 | 19년 전 | 3235 | ||
| 499 | 19년 전 | 3260 | ||
| 498 | 19년 전 | 2517 | ||
| 497 | 19년 전 | 2599 | ||
| 496 | 19년 전 | 2436 | ||
| 495 | 19년 전 | 2696 | ||
| 494 | 19년 전 | 2676 | ||
| 493 | 19년 전 | 3170 | ||
| 492 | 19년 전 | 2877 | ||
| 491 | 19년 전 | 5295 | ||
| 490 |
|
19년 전 | 2119 | |
| 489 |
|
19년 전 | 2204 | |
| 488 |
|
19년 전 | 2003 | |
| 487 |
|
19년 전 | 1936 | |
| 486 |
|
19년 전 | 1935 | |
| 485 |
|
19년 전 | 2130 | |
| 484 |
|
19년 전 | 3202 | |
| 483 |
|
19년 전 | 3085 | |
| 482 |
|
19년 전 | 2846 | |
| 481 |
|
19년 전 | 2536 | |
| 480 |
|
19년 전 | 2627 | |
| 479 |
|
19년 전 | 2291 | |
| 478 |
|
19년 전 | 2325 | |
| 477 |
개발자관리자
|
19년 전 | 1584 | |
| 476 |
개발자관리자
|
19년 전 | 2305 | |
| 475 |
개발자관리자
|
19년 전 | 2655 | |
| 474 |
개발자관리자
|
19년 전 | 2652 | |
| 473 |
개발자관리자
|
19년 전 | 2963 | |
| 472 | 19년 전 | 2729 | ||
| 471 | 19년 전 | 1719 | ||
| 470 | 19년 전 | 1818 | ||
| 469 |
|
19년 전 | 2721 | |
| 468 |
|
19년 전 | 2215 | |
| 467 |
|
19년 전 | 3990 | |
| 466 |
|
19년 전 | 2499 | |
| 465 | 19년 전 | 2372 | ||
| 464 | 19년 전 | 3518 | ||
| 463 |
|
19년 전 | 3097 | |
| 462 |
|
19년 전 | 2236 | |
| 461 |
|
19년 전 | 3030 | |
| 460 |
|
19년 전 | 2236 | |
| 459 |
|
19년 전 | 3093 | |
| 458 |
|
19년 전 | 3516 | |
| 457 |
|
19년 전 | 5209 | |
| 456 |
|
19년 전 | 3126 | |
| 455 |
스마일미디어
|
19년 전 | 3124 | |
| 454 |
스마일미디어
|
19년 전 | 2715 | |
| 453 |
스마일미디어
|
19년 전 | 2457 | |
| 452 |
스마일미디어
|
19년 전 | 2713 | |
| 451 |
스마일미디어
|
19년 전 | 2435 | |
| 450 |
스마일미디어
|
19년 전 | 2555 | |
| 449 |
스마일미디어
|
19년 전 | 2358 | |
| 448 |
스마일미디어
|
19년 전 | 2689 | |
| 447 | 19년 전 | 2956 | ||
| 446 |
스마일미디어
|
19년 전 | 3239 | |
| 445 |
스마일미디어
|
19년 전 | 7045 | |
| 444 |
스마일미디어
|
19년 전 | 5166 | |
| 443 |
스마일미디어
|
19년 전 | 2417 | |
| 442 |
스마일미디어
|
19년 전 | 5152 | |
| 441 |
스마일미디어
|
19년 전 | 3096 | |
| 440 |
|
19년 전 | 2452 | |
| 439 | 19년 전 | 2146 | ||
| 438 | 19년 전 | 3564 | ||
| 437 |
|
19년 전 | 2867 | |
| 436 |
|
19년 전 | 3246 | |
| 435 |
|
19년 전 | 2880 | |
| 434 | 19년 전 | 3375 | ||
| 433 |
sjsjin
|
19년 전 | 2705 | |
| 432 |
sjsjin
|
19년 전 | 3451 | |
| 431 |
sjsjin
|
19년 전 | 2413 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기