PDA

View Full Version : filesystemobject


ebco
12-23-2002, 07:20 AM
While modifying the txt file through the filesystemobject I got this error

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied
/test/filesystemobject/filesystem.asp, line 63

raf
12-23-2002, 07:54 AM
Can you post the code you use for the fso operaions ?

ebco
12-23-2002, 08:50 AM
This is my code

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

set t=fs.OpenTextFile(Server.MapPath("/test/countryname1.txt"),8,true)
t.WriteLine("This text will be added to the end of file")
t.Close

set fs=nothing
%>


Is it required to give permission to particular file or folder and if yes then how?

raf
12-23-2002, 09:15 AM
You indeed need to have write permissions.

I assume this file is on a server somewhere. If you're the admin, assign write permission to this file.
If it's not your own server, ask the admin to assign write permission to this file (or the folder), or to create a folder ('db') with write permissions or move the textfile over to that folder.
Most hosts that support use of database crate a db-folder for there users, so it's probably best to store the txt-file there.