<%

file = Request.QueryString("FileName")

    strPath = Server.MapPath("/FILE_PDS")&"\"& File
'경로 설정

Response.AddHeader "Content-Disposition","attachment; filename=" & file  & """"
Response.ContentType = "application/x-msdownload"

Response.CacheControl = "private"

set objFS =Server.CreateObject("Scripting.FileSystemObject")

set objF = objFS.GetFile(strPath)

Response.AddHeader "Content-Length", objF.Size

set objF = nothing

set objFS = nothing

Set objStream = Server.CreateObject("ADODB.Stream")

    objStream.Open

    objStream.Type = 1

    objStream.LoadFromFile(strPath)

    download = objStream.Read
    Response.BinaryWrite download

    Set objstream = nothing

%>

+ Recent posts