...

View Full Version : FileSystemObject?



scriptkeeper
11-02-2003, 11:47 PM
Hello everyone this is my first post in asp forums hope its not too stupid! I just want to be able to access a simple text file but I cant not seem to figure it out I have used the FileSystemObject in Javascript before! Can anyone point out the error in my ways!




<html>
<head>
</head>
<body>
<%
Dim FSO,FILE
FSO=Server.CreateObject("Scripting.FileSystemObject" )
FILE=FSO.CreateTextFile("c:\test.txt",true)
FILE.WriteLine("Some Text!" )
FILE.Close
FILE=nothing
FSO=nothing
%>
</body>
</html>

oracleguy
11-03-2003, 01:24 AM
Originally posted by scriptkeeper

<%
Dim FSO,FILE
FSO=Server.CreateObject("Scripting.FileSystemObject" )
FILE=FSO.CreateTextFile("c:\test.txt",true)
FILE.WriteLine("Some Text!" )
FILE.Close
FILE=nothing
FSO=nothing
%>


The only thing I can see is that you got an extra space after the quote on the two highlighted lines. Other than that, it seems to be fine and should work; however I didn't try it.

http://www.w3schools.com/asp/asp_ref_filesystem.asp
http://www.w3schools.com/asp/asp_ref_textstream.asp
Refer to these two links for examples.

scriptkeeper
11-03-2003, 04:35 AM
That is where I originally got it!

Morgoth
11-03-2003, 05:17 AM
2 things.

1) You might not have admin permission to create files with your server in something like your C:\

2) You are running Nortant Utilies, and your script blocking in ON, you might want to turn that off. That's a big issue when it comes to FSO.

scriptkeeper
11-03-2003, 06:37 AM
Yes I think that is it I t gives me an error now permisions denied so how would I go about setting my permisions is it part of IIS?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum