티스토리 뷰
네이버LAB 포토에디터 API (http://s.lab.naver.com/pe/api)
서버에 올려진 이미지를 수정하고자 할 때
GET방식으로 하면 되는데
http://s.lab.naver.com/pe/api?i=1&t=2 중간쯤의
파일업로드 필드(input type=file)을 통한 사용자 로컬PC 이미지를 수정하고
서버에 저장하고자 할 때
exportMethod="POST" 를 주고 시도해 보았으나 exportTo(처리)에서 exportField를 받지 못하여
결국 아래와 같이 exportMethod="BROWSER" 주고 GET 방식으로 받아서 처리하였다.
폼(입력)
서버에 올려진 이미지를 수정하고자 할 때
GET방식으로 하면 되는데
http://s.lab.naver.com/pe/api?i=1&t=2 중간쯤의
http://s.lab.naver.com/pe/service?import=http%3A%2F%2Fexample.com%2Fuser%2Fsomebody%2F1234.jpg&exportTo=http%3A%2F%2Fexample.com%2Fmyexample%2Fimage_post.jsp%3Fpid%3D1244711925301&exportMethod=GET&exportField=file&exportTitle=example.com%EC%97%90+%EC%A0%80%EC%9E%A5%ED%95%98%EA%B8%B0
와 같이 파라미터들을 주~욱 붙여 넣어주면 된다.파일업로드 필드(input type=file)을 통한 사용자 로컬PC 이미지를 수정하고
서버에 저장하고자 할 때
exportMethod="POST" 를 주고 시도해 보았으나 exportTo(처리)에서 exportField를 받지 못하여
결국 아래와 같이 exportMethod="BROWSER" 주고 GET 방식으로 받아서 처리하였다.
폼(입력)
처리(저장)네이버 포토에디터 연동 테스트
<%
Session.Codepage = 949
Response.Charset = "euc-kr"
'// Save Path
Dim savePath, saveDir
savePath = "/data"
saveDir = Server.Mappath(savePath)
Response.Write("Params From NaverLAB
[GET]
")
For Each strKey In Request.QueryString
Response.Write(strKey &" = """& Request.QueryString(strKey) &"""
")
Next
Response.Write("[POST]
")
For Each strKey In Request.Form
Response.Write(strKey &" = """& Request.Form(strKey) &"""
")
Next
Response.Write("
")
fname = Request.Querystring("fname")
If fname = "" Then Response.Write("fname is Nothing
"): Response.End
Dim imageData, imageSaveName
imageData = Request.QueryString("imageData")
If imageData = "" Then Response.Write("imageData is Nothing
"): Response.End
Response.Write("Photo In NaverLAB :
[img src='"& Request.QueryString("imageData") &"' border='0' alt='Photo In NaverLAB' /]")
imageSaveName = fname &".jpg"
Dim objXML, binXML
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET", imageData, False
objXML.Send
binXML = objXML.ResponseBody
Set objXML = Nothing
Dim objADO
Set objADO = CreateObject("ADODB.Stream")
objADO.Type = 1
objADO.Open
objADO.Write binXML
objADO.SaveToFile saveDir &"\"& imageSaveName, 2
Set objADO = Nothing
Response.Write("Saved Photo :
[img src='"& savePath &"/"& imageSaveName &"' border='0' alt='Saved Photo' /]")
%>'웹프로그래밍 > ASP Classic' 카테고리의 다른 글
| ASP 자체 Binary 이미지 나타내기 (0) | 2010.11.23 |
|---|---|
| [Classic ASP] pixlr API 활용법 (0) | 2010.11.23 |
| 문장에서 따옴표를 특수문자 따옴표로 변경해주기 (0) | 2010.11.22 |
| Classic ASP Dynamic Include (동적 인클루드) (1) | 2010.11.21 |
| 네이버 오픈API 추천검색어 변환 파싱 (jQuery, ASP 사용) (2) | 2010.08.23 |
댓글
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- API
- IE
- 워드프레스
- iphone
- Prototype
- 안드로이드
- classic asp
- git
- Debug
- Linux
- CSS
- nodejs
- macos
- PHP
- sencha touch
- Docker
- iis
- ASP
- centos
- mssql
- nginx
- JSON
- 한글
- IOS
- Mac
- Android
- laravel
- javascript
- JQuery
- Wordpress
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함