파일 강제 다운로드 소스..
나만 쓸수 있는겨~ 나만쓰는겨~ (--)
<%
'*********************************************************************************************
' Writer : 임형섭
' FilePath : /$INC/FileDownload.asp
' Contents : 파일다운로드
'*********************************************************************************************
%>
<!-- #include virtual="/$inc/site_Config.asp" -->
<!-- #include virtual="/$INC/function.asp" -->
<%
strFile= Request.Querystring("fn")
strOrgFile= Request.Querystring("ofn")
' response.write "strFile = " & strFile & "<BR>"
' response.write "strOrgFile = " & strOrgFile & "<BR>"
' response.end
Response.ContentType = "application/unknown"
Response.AddHeader "Content-Disposition","attachment; filename=" & strOrgFile
'//덱스트파일다운로드처리
Response.AddHeader "Content-Disposition","attachment;filename=" & strFile
set objFS = Server.CreateObject("Scripting.FileSystemObject")
set objF = objFS.GetFile(Server.MapPath(strUpFile)&"\"& strFile)
Response.AddHeader "Content-Length", objF.Size
set objF = nothing
set objFS = nothing
Response.ContentType = "application/unknown"
Response.CacheControl = "public"
Set objDownload = Server.CreateObject("DEXT.FileDownload")
objDownload.Download Server.MapPath(strUpFile)&"\"& strFile
Set objDownload = Nothing
'//덱스트파일다운로드처리
' '//스트림다운로드처리
' Set objStream = Server.CreateObject("ADODB.Stream")
' objStream.Open
' objStream.Type = 1
' objStream.LoadFromFile Server.MapPath(strUpFile)&"\"& strFile
' download = objStream.Read
' Response.BinaryWrite download
' Set objstream = nothing
' '//덱스트파일다운로드처리
%>