ClassicASP 다운로드 소스 (작업중)
페이지 정보
본문
<%
file = Request("file")
file = replace(file,"&","&")
response.write (file & "<br>")
'DirectoryPath = "d:\PubNet_Web\Youthbcf\popup\2008_0627"
DirectoryPath = "\\192.168.200.4\WebData\Public\youth\popup\2008_0627" 
response.write DirectoryPath    '파일 이름과 경로
Response.ContentType = "application/unknown"    'ContentType 를 선언
Response.AddHeader "Content-Disposition","attachment; filename="&file '헤더값이 첨부파일을 선언
Set objStream = Server.CreateObject("ADODB.Stream") 'Stream 을 이용
  objStream.Open
  objStream.Type = 1
  'objStream.LoadFromFile Server.MapPath(path)&"\"&file
  objStream.LoadFromFile DirectoryPath '절대경로
  download = objStream.Read
  Response.BinaryWrite download 
  '보통 Response.Redirect 로 파일로 연결시켜주는 부분을 대신하여 사용된 것
Set objstream = nothing  '초기화.
%> 
참고사이트
http://blog.naver.com/zino1187?Redirect=Log&logNo=110029954236  
댓글목록
등록된 댓글이 없습니다.


