ACTIVE SERVER PAGE > ÆÄÀÏ´Ù¿î·Îµå - ÆÄÀÏ ´Ù¿î·Îµå ±¸Çö
µî·ÏÀÏ : 2017-07-04 17:13
Á¶È¸¼ö : 52,702
ADODB.Stream °´Ã¼¸¦ ÀÌ¿ëÇÏ¿© ÆÄÀÏ ´Ù¿î·Îµå¸¦ ±¸ÇöÇØ º¸ÀÚ.
fname = request("fname")
fpath = request("fpath")
Response.Clear
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment;filename=" & fname
Response.AddHeader "Content-Transfer-Encoding", "binary"
Response.AddHeader "Preagma", "no-cache"
Response.AddHeader "Expires", "0"
Dim phyFilePath, objFs, objStream, strFile
DOWN_DIR = "/file_data/"&FNAME
phyFilePath = Server.MapPath(DOWN_DIR)
Set objFs = Server.CreateObject("scripting.FileSystemObject")
If Not objFs.FileExists(phyFilePath) Then
Response.Write "ÆÄÀÏÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù."
Response.end
Else
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type=1
objStream.LoadFromFile phyFilePath
strFile = objStream.Read
Response.BinaryWrite strFile
End If
Set strFile = Nothing
Set objStream = Nothing
Set objFs = Nothing
À§¿Í °°Àº Çü½ÄÀ¸·Î »ý¼ºÇÒ ¼ö ÀÖ½À´Ï´Ù.