Hi all,
I'm experiencing a problem with a link to a specific ASP page. When I click on the link from a browser, I am prompted to download the page rather than executing the code within. I cannot figure out why.
The code for the asp is supposed to create a text file on the server and then redirect the browser. Code looks like this:
<%
response.buffer=True
strPath = "c:\inetpub\
'This line creates an object(fso) that is used for File Access
set fso = Server.CreateObject("scripting.FileSystemObject"
'The following lines define the path and name of the temporary text file
strScriptPath = strPath & "\1234\scripts\"
tmpTextFileName = "Accept.txt"
tmpTextFilePath = CStr(strScriptPath)
createFile = CStr( tmpTextFilePath & tmpTextFileName )
set myFile = fso.CreateTextFile(createFile, true)
'Create text for above created file
line1 = "Text goes here"
'WriteLine writes the text to the text file.
myFile.WriteLine(line1)
myFile.Close
redirectDocument = "c:\inetpub\response.redirect(redirectDocument)
%>
Can anyone tell me why this is happening??
Much appreciated
Thanks
Mike
I'm experiencing a problem with a link to a specific ASP page. When I click on the link from a browser, I am prompted to download the page rather than executing the code within. I cannot figure out why.
The code for the asp is supposed to create a text file on the server and then redirect the browser. Code looks like this:
<%
response.buffer=True
strPath = "c:\inetpub\
'This line creates an object(fso) that is used for File Access
set fso = Server.CreateObject("scripting.FileSystemObject"
'The following lines define the path and name of the temporary text file
strScriptPath = strPath & "\1234\scripts\"
tmpTextFileName = "Accept.txt"
tmpTextFilePath = CStr(strScriptPath)
createFile = CStr( tmpTextFilePath & tmpTextFileName )
set myFile = fso.CreateTextFile(createFile, true)
'Create text for above created file
line1 = "Text goes here"
'WriteLine writes the text to the text file.
myFile.WriteLine(line1)
myFile.Close
redirectDocument = "c:\inetpub\response.redirect(redirectDocument)
%>
Can anyone tell me why this is happening??
Much appreciated
Thanks
Mike