각기 다른 도메인에서 이미지를 불러들여야 할일이 생겼는데,
단순히 iframe으로 구현하려고 하다가 바이너리 출력으로 하게됬습니다.
"http://도메인/파일명.asp" 등으로 이미지나 파일등을 출력할 수 있습니다.
파일타입은 각 서버의 마임타입으로 설정해주면 되고 로컬 파일도 가능합니다.
첨부파일을 받으면 각종 상황에 맞는 함수들이 있습니다.
<%
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"
binaryImage=BinaryGetURL("http://www.mysql.com/common/logos/logo_mysql_sun_a.gif")
Response.BinaryWrite binaryImage
%>
'SCRIPTING' 카테고리의 다른 글
| php ffmpeg command example on windows (0) | 2009/06/25 |
|---|---|
| [PHP] REGULAR EXPRESSION EXAMPLE preg_replace, preg_match, str_replace (1) | 2009/06/25 |
| asp binary 바이너리 파일 입출력 함수 (0) | 2009/06/23 |
| c++ win32 api char, string 키코드 알아내기 (0) | 2009/06/21 |
| mssql to mysql process log (0) | 2009/06/17 |
| php로 thumbnail만들기 (0) | 2009/06/16 |


binaryio.asp
댓글을 달아 주세요