ASP - 이미지 URL경로의 BinaryWrite 하기
제목 : ASP - 이미지 URL경로의 BinaryWrite 하기
<%
function BinaryGetURL(URL)
'Create an Http object, use any of the four objects
Dim Http
'Set Http = CreateObject("Microsoft.XMLHTTP")
'Set Http = CreateObject("MSXML2.ServerXMLHTTP")
Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")
'Set Http = CreateObject("WinHttp.WinHttpRequest")
'Send request To URL
Http.Open "GET", URL, False
Http.Send
'Get response data As a string
BinaryGetURL = Http.ResponseBody
End Function
'Response.ContentType="image/gif"
Response.ContentType="image/jpg"
'binaryImage=BinaryGetURL("http://www.mysql.com/common/logos/logo_mysql_sun_a.gif")
binaryImage=BinaryGetURL("http://local.com/file_upload/1.jpg")
Response.BinaryWrite binaryImage
%>
내용 : 확장자를 추출하는 function 이용해서 contenttype 찾고, 처리하면 될듯
Get 방식은 주석부분에서 하나 선택
테스트해본 결과 제대로 Binary로 write 됨.
오라클 DB 에 BLOB 타입으로 넣으면 되려나...
출처 :