Hi.
I am making Download Page.
And Code is located below
Problem is that it is ok in windows xp but popup a windows for 1 second and close in windows 7.
what's the problem?
--------------------------------------------------------------------------------------------------------------------------
Public Sub executeFile()
Dim fileName as String = "test.pdf"
Dim fileExten As String = ""
Dim ContentType As String = ""
Dim AddHeader As String = "attachment; filename={0}"
Dim filePath As String = "../Education_AttrFile/{0}"
'Dim filePath As String = ConfigurationSettings.AppSettings("FILEPATH").ToString() + "{0}"
fileExten = fileName.Substring(InStrRev(fileName, "."))
AddHeader = String.Format(AddHeader, fileName)
filePath = String.Format(filePath, fileName)
fileExten = fileExten.ToLower()
'contentType를 결정
If fileExten.Equals("txt") = True Then
ContentType = "text/plain"
ElseIf fileExten.Equals("doc") = True Then
ContentType = "Application/msword"
ElseIf fileExten.Equals("xls") = True Then
ContentType = "Application/x-msexcel"
ElseIf fileExten.Equals("pdf") = True Then
ContentType = "application/pdf"
ElseIf fileExten.Equals("jpg") = True Or fileExten.Equals("jpeg") = True Then
ContentType = "image/jpeg"
ElseIf fileExten.Equals("gif") = True Then
ContentType = "image/GIF"
ElseIf fileExten.Equals("png") = True Then
ContentType = "image/png"
End If
Response.Buffer = False
Response.Clear()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = ContentType
Response.AddHeader("Content-Disposition", AddHeader)
Response.WriteFile(filePath)
Response.End()
End Sub 'Public Sub executeFile(ByVal fileName As String)