I have a classic asp page that creates a file on the server. This file needs to be downloaded to my client's pc and then have a new webpage shown. My script creates the file, the file is download using the following function, but I can not get any type of redirect to work. I have tried this same download code in a separate file, adding the redirect in the calling and called file and nothing works. After the download completes, the page remains unchanged.
strAbsFile = Server.MapPath("\TimeMag") & "\" & sFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strAbsFile) Then
Set objFile = objFSO.GetFile(strAbsFile)
ContentType = "application/x-msdownload"
Response.Buffer = True
Const adTypeBinary = 1
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = adTypeBinary
ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment; filename=""" & objFile.Name & """"
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Set objStream = Nothing