Hi all, I am an newbie in ASP.I am trying to create a file using this code :- Dim objFSO ' File System Object Dim objFile ' File Object set objFSO=Server.CreateObject("Scripting.filesystemobject") set objFile=objFSO.CreateTextFile("test.txt",false) objFile.Write "Hello World" objFile.Close set objFile=nothing set objFSO=nothing But i am getting an error page saying permission denied.What could be wrong ? Please help.
Next time send entire error/exception message. However i'll try to guess that maybe test.txt already exists on that location so you need to set up the overwrite argument to true: set objFile=objFSO.CreateTextFile("test.txt", [B]True[/B]) Code (markup): Otherwise set the permissions. You must give the rights to write to the directory as by default it's always only "read + scripts allowed". HTH Regards
Right click on the folder->Click on Sharing and Security ->Check if you have write permission for your login. Sometimes this doesn't work either, if you are trying to create a file on server. You have to make sure you have "Users" on the admin list. Allow Users Write permission on the folder same way like above.
You may want to change the file name that it creates. If this is still a problem then it is a permission issue and you should ask your host how to change permissions. You may be able to do it via your FTP client.