I am using Windows 2003 and have an IIS website.
I created a file called test.asp
in the c:\inetpub\wwwroot
directory with the following contents:
<html>
<body>
<p>This is the text in the text file:</p>
<%
Set fs = Server.CreateObject("Scripting.FileSystemObject")
set f = fs.CreateTextFile(Server.MapPath("testread.txt"), true)
Response.Write("This Worked!")
f.Close
Set f = Nothing
Set fs = Nothing
%>
</body>
</html>
When I view the page, I get the generic "Page cannot be displayed" which makes me think that there is an error in my script. I have tracked it down to the CreateTextFile
function, it somehow fails.
My First question:
Is there anyway to debug this? I don't know how to view errors with this page, I always just get the "Page cannot be displayed".
Second question:
I don't know if there might be some sort of permissions issue? I tried setting the permissions of the Scripting.FileSystemObject
key in registry to full control for EVERYONE
.
I don't know what else could be preventing me from writing a file? I have verified that I can read a file with no problems.