티스토리 뷰

pixlr API를 이용하여 사용자 로컬 이미지 전송, 편집 후 서버에 저장하기

폼 :

pixlr 연동 테스트

처리 :
<%
Session.Codepage = 949
Response.Charset = "euc-kr"

'// Save Path
Dim savePath, saveDir
savePath = "/data"
saveDir = Server.Mappath(savePath)

Response.Write("

[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("

") Dim imageData, imageSaveName imageData = Request.QueryString("image") If imageData = "" Then Response.Write("imageData is Nothing
"): Response.End %>

Photo In Pixlr :
Photo In Pixlr

<% imageName = Request.QueryString("title") '// 사용자 지정 파일명 imageType = Request.QueryString("type") '// jpg, png, gif ... imageSaveName = imageName &"."& imageType 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 %>

Saved Photo :
Saved Photo

댓글