% @LANGUAGE='VBSCRIPT' CODEPAGE='65001' %>
<%
Response.CharSet = "utf-8"
'if isTestAdmin() then
' response.end
'end if
' ##############################################################################
' IIS 6.0¿¡¼´Â ASP ¿¡¼ ±âº» ´Ù¿î·Îµå ¹öÆÛ¸µ ¿ë·®À» 4MB·Î Á¦ÇÑ.
' IIS ±âº» ¼³Á¤Àº C:\Windows\system32\inetsrv\MetaBase.xml ¿¡ ÀúÀå µÇ¾î ÀÖÀ¸¸ç,
' À§ÀÇ ¸ÞŸº£À̽º XMLÆÄÀÏ¿¡¼ AspBufferingLimit °ªÀ» ¿øÇÏ´Â »çÀÌÁŠ´Ã·ÁÁÖ¸é ÇØ°áÀÌ °¡´É.
'
' ´Ù¿î·ÎµåÁ¦ÇÑ : AspBufferingLimit="4194304" - 4MB
' ¾÷·ÎµåÁ¦ÇÑ : AspMaxRequestEntityAllowed="204800" - 200KB
' ¼¹ö ÆÄÀÏ ¼öÁ¤ÈÄ ÀçºÎÆÃ ÇÊ¿ä
'
' ¼öÁ¤ÀÏ : 2010. 9. 7
' ##############################################################################
Response.Expires = 0
Response.Buffer = True
Function existFile(fName)
existFile = False
Dim filePath
filePath = fName
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(filePath)=true Then '
existFile = True
End If
Set fso = Nothing
End Function
'response.end
On Error Resume Next
Dim fileName, fileTxt, filePath, fileType
fileName = request.querystring("fn")
'fileName = base64Decode(fileName)
'fileTxt = request.querystring("ft")
'fileTxt = base64Decode(fileTxt)
fileTxt = "pdf"
fileType = request.querystring("fp")
fileType = request.querystring("fp")
'call getserverInfo()
'select case fileType
' case 1 : filePath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "\program\upload\textbox\" & fileName
' case 2 : filePath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "\program\upload\textbook\" & fileName
' case 3 : filePath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "\program\upload\ptfile\" & fileName
' case else : filePath = Server.MapPath(".") &"\" & fileName
'end select
filePath = Server.MapPath(".") & "\"& fileName
'if isTestAdmin() then
' echo filePath
' response.end
'end if
if not existFile(filePath) then
response.clear()
'echobr filePath
Response.write "Sorry, the file you requested was not found"
resposne.end
else
if fileName="ICAAP10_MR.mp3" then
Call dbConOpen()
dbCon.execute("update mp3Down set downNum=downNum+1")
Call dbConClose()
end if
Response.Clear
Response.ContentType = "application/unknown"
Response.CacheControl = "public"
'Response.AddHeader "Content-Disposition", "attachment;filename=" & fileTxt
Response.AddHeader "Content-Disposition", "attachment;filename=" & fileName
' Stream ÀÌ¿ë --------------------------------------------------------------
Dim Stream
set Stream=Server.CreateObject("ADODB.Stream")
Stream.Open
Stream.Type=1
'echobr filepath
'response.end
Stream.LoadFromFile filepath
Response.BinaryWrite Stream.Read
Stream.close
set Stream=nothing
' --------------------------------------------------------------------------
end if
' »çÀÌÆ®°¶·°½Ã¸¦ ÀÌ¿ëÇÏ¿© ´Ù¿î·ÎµåÇϱâ -----------------------------------------
'set fso = server.CreateObject("SiteGalaxyUpload.FileSystemObject")
'set file = fso.OpenBinaryFile (filepath,1,false)
'Response.BinaryWrite file.ReadAll
'
'Set file = Nothing
'Set fso = Nothing
' ------------------------------------------------------------------------------
%>