<% Dim action Set action = New BbsAction file_no = Request("file") arrayList = action.getFileView_BBS(file_no) 'Response.Charset = "euc-kr" Dim filepath, fileName filepath ="../../../../upload/board/" & arrayList(8, 0) strOrgfileName = arrayList(3, 0) strNewfileName = arrayList(4, 0) ' Response.Write filepath & "
" ' Response.Write strOrgfileName & "
" ' Response.Write strNewfileName & "
" ' Response.write SERVER.MAPPATH(filePath) & "\" & strNewfileName 'DownloadFile(fileName,orgfileName,filePath) 'Call DownloadFiles(filepath, strOrgfileName, strNewfileName) 'FUNCTION DownloadFiles(filepath, strOrgfileName, strNewfileName) Response.Charset = "UTF-8" RESPONSE.CLEAR(): '//버퍼 비움 - 중복 방지 RESPONSE.CONTENTTYPE = "application/unknown": '//컨텐트 타입을 알수 없는 상태로 선언 RESPONSE.ADDHEADER "Content-Disposition","attachment; filename=" & Server.URLpathencode(strOrgfileName): '//헤더값에 첨부파일을 선언 Dim OBJSTREAM SET OBJSTREAM = SERVER.CREATEOBJECT("ADODB.STREAM") OBJSTREAM.OPEN: OBJSTREAM.TYPE = 1: ' Response.write SERVER.MAPPATH(filePath) & "\" & fileName OBJSTREAM.LOADFROMFILE SERVER.MAPPATH(filepath) & "\" & strNewfileName: '//파일의 절대 경로 RESPONSE.BINARYWRITE OBJSTREAM.READ: SET OBJSTREAM = NOTHING: RESPONSE.END(): 'END FUNCTION %>