¾È±Ô °øºÎ¹æ

ACTIVE SERVER PAGE > ÆÄÀÏ´Ù¿î·Îµå - ÆÄÀÏ ´Ù¿î·Îµå ±¸Çö

µî·ÏÀÏ : 2017-07-04 17:13 Á¶È¸¼ö : 33,900

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


À§¿Í °°Àº Çü½ÄÀ¸·Î »ý¼ºÇÒ ¼ö ÀÖ½À´Ï´Ù.
 
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.