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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenTextFile causes the browser to hang.

Status
Not open for further replies.

feemi

Programmer
Feb 3, 2001
17
US
I have the following code in my ASP page:

If fso.FileExists(Server.MapPath("test.txt")) Then
sourcefile = "test.txt"
Response.Write &quot;<BR>Success&quot;
else
Response.Write &quot;<BR>fail&quot;
end if

This returns success everytime. If I add this line of code :

Set f = fso_OpenTextFile(sourcefile,ForReading,false,-2)

the browser hangs. I'm not sure if it EVER actually returns anything. I'm running IIS 5.0 on Windows 2000 Pro, IE 5.5. I have given my anonymous user admin rights to the directory, not a solution.

Any ideas would be most excellent.

Thanks in advance.
 
What happens on
On Error Resume Next
Set f = fso_OpenTextFile(sourcefile,ForReading,false,-2)
if Err.Number <> 0 then
Response.Write .ErrDescription
End If
On Error goto 0


Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Got Antivirus on?

&quot;This problem occurs because the Script Blocking feature in Norton AntiVirus software blocks scripting operations that access the file system, such as FileSystemObject . Although this problem is prevalent in Active Server Pages (ASP) Web applications, it can also occur in other technologies, such as Windows Scripting.&quot; Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Norton was the problem. I searched all through the KB last night and didn't find this article. Go figure.

Thanks for the help!
 
Did you search KB or just use Search at MSDN.MICROSOFT.COM?
KB search is no longer automatic. To search KB you must click Advanced Search, check the KB box and then enter your search. Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top