PDA

View Full Version : ASP: Writing to files?



ziphnor
October 27th, 2001, 18:07
Im just starting learn some ASP for fun, and im doing okay but i have what
i think is a little setup problem.
Im using this code i found at http://www.w3schools.com/asp/:

(str1 defined here as well as some html printed)
...
dim fs2,f2
Set fs2=Server.CreateObject("Scripting.FileSystemObject")
Set f2=fs2.OpenTextFile(Server.MapPath("input.txt"), 2)
f2.Write(str1)
f2.Close
Set f2=Nothing
Set fs2=Nothing

When i try to load the script i get this as an error:
"Microsoft VBScript runtime (0x800A0046)
Permission denied
/proc.asp, line 10" [ Line 10 is Set f2=fs2.OpenTextFile(Server.MapPath("input.txt"),
2) ]

If i try to read from the file instead it works fine, so im assuming its
because my setup wont allow writing to a file.
Im using the IIS server that came with Windows XP Professional and i cant
really seem to find an option to allow writing. Can anyone help?

Omair Haroon
October 30th, 2001, 09:50
If I can recall my memory properly, I think it is somewhere in MMC to allow the permissions for a virtual directory. If you find it, mkae sure that Writable Directory or something like that is checked.

I was used to this all before when I used to be on WIN XP. But I have now shifted back to ole' Win 98 :)



-Omair

ziphnor
October 31st, 2001, 15:49
What is the the MMC? I already have a virtual dir i think, and as far as i can see the file permissions are set up correctly.
This is driving me insane :)