I have a couple web pages where a user can generate a file extract from the database. Basically, I get the data and format it via 'reponse.write' commands, then perform the code below. This generates a file that the user can open or download. HOWEVER, from that point on, the URL in the address box doesn't change when you move on to other pages. Everything works fine, but you need to enter a new URL for the address box to start reflecting the page you are on. Can someone tell me why this happens (and how to correct)?
THANKS!!!
'declare our variables
Dim objFSO , myFile
'create an instance of the FileSystemObject
'Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
filename = Server.MapPath("access/mailing.txt")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'create a text file called mytestfile.txt
Set myFile = objFSO.CreateTextFile(filename, True)
'write a couple of lines of text in the file
myFile.WriteLine("")
myFile.Close
'destroy the object
Set myFile = Nothing
Set objFSO = Nothing
set fs=server.CreateObject("scripting.filesystemobject")
set objfile=fs.GetFile(filename)
size=objfile.size
fname=objfile.name
mime_type="application/save-as"
Response.AddHeader "Expires:",0
Response.ContentType=mime_type
Response.AddHeader "Content-Disposition","attachment; filename="&fname
set objStream =server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type=1
objStream.LoadFromFile filename
Response.BinaryWrite objStream.Read
Response.end
THANKS!!!
'declare our variables
Dim objFSO , myFile
'create an instance of the FileSystemObject
'Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
filename = Server.MapPath("access/mailing.txt")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'create a text file called mytestfile.txt
Set myFile = objFSO.CreateTextFile(filename, True)
'write a couple of lines of text in the file
myFile.WriteLine("")
myFile.Close
'destroy the object
Set myFile = Nothing
Set objFSO = Nothing
set fs=server.CreateObject("scripting.filesystemobject")
set objfile=fs.GetFile(filename)
size=objfile.size
fname=objfile.name
mime_type="application/save-as"
Response.AddHeader "Expires:",0
Response.ContentType=mime_type
Response.AddHeader "Content-Disposition","attachment; filename="&fname
set objStream =server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type=1
objStream.LoadFromFile filename
Response.BinaryWrite objStream.Read
Response.end