Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP page not working

Status
Not open for further replies.

msturges

Programmer
Mar 29, 2001
32
0
0
ZA
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 = &quot;c:\inetpub\
'This line creates an object(fso) that is used for File Access
set fso = Server.CreateObject(&quot;scripting.FileSystemObject&quot;)

'The following lines define the path and name of the temporary text file

strScriptPath = strPath & &quot;\1234\scripts\&quot;
tmpTextFileName = &quot;Accept.txt&quot;
tmpTextFilePath = CStr(strScriptPath)
createFile = CStr( tmpTextFilePath & tmpTextFileName )
set myFile = fso.CreateTextFile(createFile, true)

'Create text for above created file
line1 = &quot;Text goes here&quot;


'WriteLine writes the text to the text file.
myFile.WriteLine(line1)

myFile.Close

redirectDocument = &quot;c:\inetpub\response.redirect(redirectDocument)
%>


Can anyone tell me why this is happening??

Much appreciated
Thanks
Mike
 
change this:

redirectDocument = &quot;c:\inetpub\response.redirect(redirectDocument)

to this:

redirectDocument = &quot;response.redirect(redirectDocument)

ASP pages must be accessed via http:// protocol.
penny.gif
penny.gif
 
I tried that, but the result is still the same.

I don't think it's even reaching that point in the ASP file yet. The minute I click the link to the asp file from the previous page I get the prompted to download the asp file itself. I don't think it's 'reading' it at all.

any more suggestions??

 
If your webserver is running (PWS, IIS, whatever), and you access the page via http:// protocol, then it won't try to download.

The only way it will try to download is if you try to access it via a disk path:

c:\path\file.asp

The link you're clicking must have that type of path in it. Double check everything.

:)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top