<%@ codepage = 65001%>
<% session.codepage = 65001 %> 
<%Response.CharSet = "UTF-8"%>
<%

fileName = "test.zip"
filepath = "D:\www\company\aspmssqlwa.nninc.co.kr\data\board\board_2\"&fileName
		
'		Dim objFS, objF 
'		Dim objStream, strFile 
'		Response.Clear
'		Response.ContentType="application/octect-stream name= " & fileName
'
'		Response.AddHeader "Content-Disposition", "attachment;filename="&fileName &"" '파일명
'		Response.AddHeader "Content-Transfer-Encoding", "binary"
'		Response.AddHeader "Pragma", "no-cache"
'		Response.AddHeader "Expires", "0" 
'
'		' 스트림을 선언
'		Set objStream = Server.CreateObject("ADODB.Stream")
'		objStream.Open
'		objStream.Type = 1
'		objStream.LoadFromFile filepath '다운받을경로(파일명포함)
'		strFile = objStream.Read
'		Response.BinaryWrite strFile
'		Set objStream = Nothing 
		



	'Response.Buffer = TRUE
	Response.Clear
	Response.Expires = 0
	Response.ContentType = "application/smnet"
	Const adTypeBinary = 1
	Const adTypeText = 2
	Response.AddHeader "Content-Disposition","attachment;filename=" & fileName
	Set objStream = Server.CreateObject("ADODB.Stream")
	objStream.Type = adTypeBinary
	objStream.Open
	objStream.LoadFromFile(filepath)
	'추가시작
	Response.Buffer=false
	Dim buff
	do
		buff=objStream.Read(102400)
		Response.BinaryWrite buff
		On Error Resume Next
	loop while(len(buff)>0)


	'    Response.BinaryWrite objStream.Read(objStream.Size)
	set buff = nothing
	objStream.Close
	Set objStream = Nothing
	Response.Flush



%>