티스토리 뷰

개발

덱스트업로드, 썸네일만들기

Hello™ 2014. 10. 13. 11:15

덱스트 업로드 설명서 관련

http://support.dextsolution.com/TechDoc/view.aspx?kb_id=P_000014


* 섬네일 이미지 만드는 imageProc부분일 것이다. 이게 프로부터 지원한다고.

이미지 정의하는 부분에서 오류가 나면 썸네일을 지원하지 않는 버전일듯.

<%

Call printRequestValue()


' 받아온 값

fileup = getData("fileup")



'기본업로드 경로

defaultPath = server.mappath("/fileup/test/hello/")

Set uploadForm = Server.CreateObject("DEXT.FileUpload")

uploadForm.DefaultPath = defaultPath

uploadForm.AutoMakeFolder = True



' 등록한 이미지의 가로/세로크기 구하기

imgWidth = uploadForm("fileup").ImageWidth

imgHeight = uploadForm("fileup").ImageHeight

tempFileName = uploadForm.Filename



' 기본이미지 저장

uploadform("fileup").Save, False

lastSavedFileName = uploadform("fileup").LastSavedFileName



' 썸네일이미지를 만들기위한사전작업

Set objImage = Server.CreateObject("DEXT.ImageProc")

imgDefaultFilePath = defaultPath& "\"


' 이미지 가로사이즈 지정

defaultWidth = 360


If imgWidth > defaultWidth Then

imgWidthM = defaultWidth

imgWidthH = defaultWidth * imgHeight / imgWidth

End If



' 썸네일이미지 저장하기

If True = objImage.SetSourceFile(imgDefaultFilePath & lastSavedFileName) Then

lastSavedThumbnailFileName = objImage.SaveAsThumbnail (imgDefaultFilePath &"\m\" & lastSavedFileName, imgWidthM, imgWidthH, False)

End If



'  올렸으면 업로드 해제

Set uploadForm = Nothing

Set objImage = Nothing

%>