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>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 430 | 19년 전 | 4102 | ||
| 429 | 19년 전 | 3305 | ||
| 428 | 19년 전 | 4132 | ||
| 427 | 19년 전 | 3474 | ||
| 426 | 19년 전 | 3106 | ||
| 425 | 19년 전 | 3408 | ||
| 424 | 19년 전 | 2438 | ||
| 423 | 19년 전 | 2867 | ||
| 422 | 19년 전 | 2353 | ||
| 421 | 19년 전 | 3708 | ||
| 420 | 19년 전 | 4743 | ||
| 419 | 19년 전 | 3803 | ||
| 418 |
|
19년 전 | 1751 | |
| 417 | 19년 전 | 2749 | ||
| 416 | 19년 전 | 2392 | ||
| 415 | 19년 전 | 2607 | ||
| 414 | 19년 전 | 4411 | ||
| 413 |
|
19년 전 | 2601 | |
| 412 | 19년 전 | 3048 | ||
| 411 |
|
19년 전 | 2996 | |
| 410 |
|
19년 전 | 3687 | |
| 409 |
|
19년 전 | 3637 | |
| 408 |
|
19년 전 | 1860 | |
| 407 | 19년 전 | 2230 | ||
| 406 | 19년 전 | 2784 | ||
| 405 | 19년 전 | 2452 | ||
| 404 | 19년 전 | 4304 | ||
| 403 | 19년 전 | 3305 | ||
| 402 |
NeoGenesis
|
19년 전 | 4091 | |
| 401 | 19년 전 | 2610 | ||
| 400 |
|
19년 전 | 2500 | |
| 399 | 19년 전 | 2957 | ||
| 398 | 19년 전 | 2488 | ||
| 397 | 19년 전 | 2780 | ||
| 396 | 19년 전 | 2481 | ||
| 395 | 19년 전 | 3186 | ||
| 394 | 19년 전 | 1725 | ||
| 393 | 19년 전 | 2994 | ||
| 392 | 19년 전 | 2257 | ||
| 391 | 19년 전 | 2177 | ||
| 390 | 19년 전 | 2287 | ||
| 389 | 19년 전 | 2646 | ||
| 388 | 19년 전 | 2181 | ||
| 387 | 19년 전 | 4485 | ||
| 386 |
|
19년 전 | 2693 | |
| 385 |
|
19년 전 | 2483 | |
| 384 | 19년 전 | 3020 | ||
| 383 | 19년 전 | 3056 | ||
| 382 | 19년 전 | 3109 | ||
| 381 |
|
19년 전 | 2632 | |
| 380 |
|
19년 전 | 3021 | |
| 379 | 19년 전 | 2550 | ||
| 378 | 19년 전 | 2208 | ||
| 377 | 19년 전 | 2779 | ||
| 376 | 19년 전 | 2470 | ||
| 375 |
|
19년 전 | 2564 | |
| 374 | 19년 전 | 3821 | ||
| 373 | 19년 전 | 3270 | ||
| 372 | 19년 전 | 4989 | ||
| 371 |
세은아빠2
|
19년 전 | 2415 | |
| 370 | 19년 전 | 4502 | ||
| 369 | 19년 전 | 3109 | ||
| 368 | 19년 전 | 2907 | ||
| 367 | 19년 전 | 3726 | ||
| 366 | 19년 전 | 2656 | ||
| 365 | 19년 전 | 3738 | ||
| 364 | 19년 전 | 4015 | ||
| 363 | 19년 전 | 3442 | ||
| 362 | 19년 전 | 3483 | ||
| 361 | 19년 전 | 4108 | ||
| 360 |
hwatta
|
19년 전 | 2366 | |
| 359 | 19년 전 | 5108 | ||
| 358 | 19년 전 | 3656 | ||
| 357 | 19년 전 | 2601 | ||
| 356 |
sdesign1s
|
19년 전 | 2279 | |
| 355 | 20년 전 | 2757 | ||
| 354 | 20년 전 | 3030 | ||
| 353 | 20년 전 | 2795 | ||
| 352 |
|
20년 전 | 5776 | |
| 351 |
|
20년 전 | 2705 | |
| 350 |
|
20년 전 | 4293 | |
| 349 |
hwatta
|
20년 전 | 2183 | |
| 348 | 20년 전 | 7307 | ||
| 347 | 20년 전 | 2414 | ||
| 346 | 20년 전 | 3505 | ||
| 345 | 20년 전 | 4311 | ||
| 344 | 20년 전 | 2652 | ||
| 343 | 20년 전 | 3922 | ||
| 342 | 20년 전 | 3069 | ||
| 341 | 20년 전 | 4094 | ||
| 340 |
|
20년 전 | 5143 | |
| 339 |
|
20년 전 | 4236 | |
| 338 | 20년 전 | 5872 | ||
| 337 | 20년 전 | 2045 | ||
| 336 |
|
20년 전 | 3325 | |
| 335 |
|
20년 전 | 3540 | |
| 334 |
|
20년 전 | 2931 | |
| 333 |
hwatta
|
20년 전 | 2437 | |
| 332 | 20년 전 | 4656 | ||
| 331 | 20년 전 | 2274 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기