ASP에서 파일다운로드시 파일 확장자별 ContentType 설정에 관한 내용입니다.


사용법

Ex)

Response.ContentType = "application/vnd.ms-excel"

Response.AddHeader "Content-Disposition" , "attachment; filename=test.xls"

 

-----------------------------------------------------------------

.asf : video/x-ms-asf                               asf동영상 파일
.asp : text/asp                                        asp소스 파일
.avi : video/x-msvideo                             avi동영상 파일
.bmp : image/bmp                                   비트맵이미지 파일
.css : text/css                                        CSS스타일시트 파일
.doc : application/msword                        MS워드 파일
.exe : application/octet-stream                 응용프로그램 파일
.gif : image/gif                                        gif이미지 파일
.htm : text/html                                         htm웹페이지 파일
.html : text/html                                        html웹페이지 파일
.ico : image/x-icon                                  아이콘 파일
.java : text/plain                                      자바 소스파일
.jpeg : image/jpeg                                   JPEG이미지 파일
.jpg : image/jpeg                                     JPG이미지 파일
.js : application/x-javascript                     Javascript 파일
.mp3 : audio/mpeg3                                  MP3오디오 파일
.mpeg : video/mpeg                                 MPEG동영상 파일
.mpg : audio/mpeg                                   MPG동영상 파일
.png : image/png                                     PNG이미지 파일                             
.ppt : application/vnd.ms-powerpoint         파워포인트 파일
.swf : application/x-shockwave-flash        플래쉬 파일
.txt : application/octet-stream                    txt
.xls : application/ms-excel                       엑셀 파일
.xml : application/xml                               xml 파일
.zip : application/zip                                zip압축 파일

---------------------------------------------------------------

Posted by 탁이98
,