일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- readonly
- RTL88x2BU
- utf-8
- println
- ASP
- Getrows
- synology
- javascript
- 무선랜카드
- XMLHTTP
- AC1300
- Injection
- lsusb
- 시놀로지
- 따라다니는 배너
- form
- submit
- jquery 레이어
- PHP GCM
- euc-kr
- 크로스 컴파일
- FileSystemObject
- jQuery
- 커널
- disabled
- include
- ajax
- replace
- SQL Injection
- DS718+
- Today
- Total
아는 것이 좋은 것이다.
[ASP] 이미지 가져오기(참고) 본문
<%
'### Xml 이미지 시작 ###
Function Image_DisPlay(imgPath, numKind)
Randomize()
Dim numID : numID = Int((Rnd() * 1000) + 1) '랜덤ID
Dim FileFormat : FileFormat = UCase(Mid(imgPath,InStrrev(imgPath, ".") + 1)) '확장자
SavePath = Server.MapPath("/") & "\Upload\XmlImg\" '폴더경로
FileName = numID & "." & FileFormat '로컬에 저장될 파일명
'이미지 가져오기
Set Http= CreateObject("MSXML2.ServerXMLHTTP")
Http.Open "GET", imgPath, false
Http.Send()
binData = Http.ResponseBody
Set Http = Nothing
'이미지 저장
Set Stream = CreateObject("ADODB.Stream")
Stream.open()
Stream.type = 1
Stream.Write binData
Stream.SaveToFile SavePath & FileName, 2
Set Stream = Nothing
'이미지 바로 출력
If numKind = 1 Then
Response.BinaryWrite binData
'파일명 넘기기
Else
Image_DisPlay = FileName
End If
End Function
'### Xml 이미지 끝 ###
'1번 호출
Call Image_DisPlay("http://cafethumb2.naver.net/data21/2007/2/11/281/123.jpg", 1)
'2번 호출
'imgPath = Image_DisPlay("http://cafethumb2.naver.net/data21/2007/2/11/281/123.jpg", 2)
'Response.Write "<img src='http://test.kr/Upload/XmlImg/" & imgPath & "'>"
%>
'ASP' 카테고리의 다른 글
[ASP] 환경변수 정리 (0) | 2014.04.24 |
---|---|
[ASP] <textarea> 내의 내용 줄바꿈처리(br) 방법 (0) | 2014.04.24 |
[ASP] 배너 카운트 처리 (0) | 2014.04.24 |
[ASP] 이미지 리사이즈 (0) | 2014.04.24 |
[ASP] 파일을 DB에 업로드, 다운로드 하기(참고용) (0) | 2014.04.24 |