3초기억력

ASP - WinHttpRequest 의 getResponseHeader() 메소드 본문

플밍_ASP

ASP - WinHttpRequest 의 getResponseHeader() 메소드

잠수콩 2011. 4. 20. 11:43
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


제목 : WinHttpRequest 의 getResponseHeader() 메소드


<%

Function BinaryGetURL(URL)

    Dim Http

    Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")

    Http.Open "GET", URL, False

    Http.Send

    'BinaryGetURL = Http.GetAllResponseHeaders    '전체 헤더값

    BinaryGetURL = Http.getResponseHeader("Content-Type")    'Content-Type 만 추출

End Function

response.write BinaryGetURL("http://imgnews.naver.com/image/mtentertain/2011/04/18/2011041810193453548_1.jpg") 

%>


내용 : url의 파일의 content-type 을 구하려고 하다가 찾아낸 method

물론 예제에는 jpg가 붙어있는 url 로 하였으나,

어느 사이트는 이미지 확장자가 아닌 다른 파일로 content-type을 이미지로 변경하는 곳이 있어서, 만들게 됨. 




Comments