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년 전 | 1233 | |
| 529 |
|
19년 전 | 1415 | |
| 528 |
|
19년 전 | 1978 | |
| 527 |
사랑과우정
|
19년 전 | 2389 | |
| 526 | 19년 전 | 2870 | ||
| 525 |
|
19년 전 | 2296 | |
| 524 |
|
19년 전 | 1804 | |
| 523 | 19년 전 | 7039 | ||
| 522 |
|
19년 전 | 3729 | |
| 521 | 19년 전 | 2340 | ||
| 520 | 19년 전 | 2375 | ||
| 519 | 19년 전 | 2873 | ||
| 518 |
|
19년 전 | 5783 | |
| 517 |
|
19년 전 | 5558 | |
| 516 |
|
19년 전 | 2261 | |
| 515 |
|
19년 전 | 3300 | |
| 514 | 19년 전 | 2867 | ||
| 513 | 19년 전 | 2219 | ||
| 512 |
개발자관리자
|
19년 전 | 2730 | |
| 511 |
개발자관리자
|
19년 전 | 1585 | |
| 510 |
개발자관리자
|
19년 전 | 1741 | |
| 509 |
개발자관리자
|
19년 전 | 1846 | |
| 508 |
개발자관리자
|
19년 전 | 2009 | |
| 507 |
개발자관리자
|
19년 전 | 1687 | |
| 506 |
개발자관리자
|
19년 전 | 1808 | |
| 505 |
개발자관리자
|
19년 전 | 1776 | |
| 504 |
개발자관리자
|
19년 전 | 1856 | |
| 503 |
개발자관리자
|
19년 전 | 1521 | |
| 502 |
개발자관리자
|
19년 전 | 2652 | |
| 501 | 19년 전 | 2000 | ||
| 500 | 19년 전 | 3239 | ||
| 499 | 19년 전 | 3271 | ||
| 498 | 19년 전 | 2528 | ||
| 497 | 19년 전 | 2602 | ||
| 496 | 19년 전 | 2444 | ||
| 495 | 19년 전 | 2700 | ||
| 494 | 19년 전 | 2680 | ||
| 493 | 19년 전 | 3182 | ||
| 492 | 19년 전 | 2896 | ||
| 491 | 19년 전 | 5310 | ||
| 490 |
|
19년 전 | 2127 | |
| 489 |
|
19년 전 | 2213 | |
| 488 |
|
19년 전 | 2008 | |
| 487 |
|
19년 전 | 1946 | |
| 486 |
|
19년 전 | 1940 | |
| 485 |
|
19년 전 | 2142 | |
| 484 |
|
19년 전 | 3215 | |
| 483 |
|
19년 전 | 3096 | |
| 482 |
|
19년 전 | 2855 | |
| 481 |
|
19년 전 | 2548 | |
| 480 |
|
19년 전 | 2633 | |
| 479 |
|
19년 전 | 2297 | |
| 478 |
|
19년 전 | 2328 | |
| 477 |
개발자관리자
|
19년 전 | 1592 | |
| 476 |
개발자관리자
|
19년 전 | 2310 | |
| 475 |
개발자관리자
|
19년 전 | 2659 | |
| 474 |
개발자관리자
|
19년 전 | 2659 | |
| 473 |
개발자관리자
|
19년 전 | 2969 | |
| 472 | 19년 전 | 2738 | ||
| 471 | 19년 전 | 1730 | ||
| 470 | 19년 전 | 1829 | ||
| 469 |
|
19년 전 | 2730 | |
| 468 |
|
19년 전 | 2222 | |
| 467 |
|
19년 전 | 3996 | |
| 466 |
|
19년 전 | 2511 | |
| 465 | 19년 전 | 2380 | ||
| 464 | 19년 전 | 3527 | ||
| 463 |
|
19년 전 | 3101 | |
| 462 |
|
19년 전 | 2243 | |
| 461 |
|
19년 전 | 3037 | |
| 460 |
|
19년 전 | 2241 | |
| 459 |
|
19년 전 | 3105 | |
| 458 |
|
19년 전 | 3532 | |
| 457 |
|
19년 전 | 5215 | |
| 456 |
|
19년 전 | 3136 | |
| 455 |
스마일미디어
|
19년 전 | 3132 | |
| 454 |
스마일미디어
|
19년 전 | 2721 | |
| 453 |
스마일미디어
|
19년 전 | 2467 | |
| 452 |
스마일미디어
|
19년 전 | 2722 | |
| 451 |
스마일미디어
|
19년 전 | 2450 | |
| 450 |
스마일미디어
|
19년 전 | 2567 | |
| 449 |
스마일미디어
|
19년 전 | 2366 | |
| 448 |
스마일미디어
|
19년 전 | 2692 | |
| 447 | 19년 전 | 2960 | ||
| 446 |
스마일미디어
|
19년 전 | 3244 | |
| 445 |
스마일미디어
|
19년 전 | 7048 | |
| 444 |
스마일미디어
|
19년 전 | 5170 | |
| 443 |
스마일미디어
|
19년 전 | 2429 | |
| 442 |
스마일미디어
|
19년 전 | 5165 | |
| 441 |
스마일미디어
|
19년 전 | 3103 | |
| 440 |
|
19년 전 | 2463 | |
| 439 | 19년 전 | 2159 | ||
| 438 | 19년 전 | 3567 | ||
| 437 |
|
19년 전 | 2869 | |
| 436 |
|
19년 전 | 3250 | |
| 435 |
|
19년 전 | 2892 | |
| 434 | 19년 전 | 3384 | ||
| 433 |
sjsjin
|
19년 전 | 2712 | |
| 432 |
sjsjin
|
19년 전 | 3456 | |
| 431 |
sjsjin
|
19년 전 | 2417 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기