Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Permission error, FSO.CreateTextFile 1

Status
Not open for further replies.

barandjelovic

Programmer
May 24, 2001
4
US
Platform: Win2000 Server, IIS 5

Here is the server javascript ASP code:
var fs = Server.CreateObject("Scripting.FileSystemObject");
var path = Server.Mappath("test.template");
var tf = fs.CreateTextFile(path, true); //(line 37)

Here is the error:
Microsoft JScript runtime error '800a0046'
Permission denied
/admin/master.template.new.asp, line 37

Can you please help me configure the permissions so that this page can save the files?

Thank you.
 
Hi

Your code runs with my default settings.
These are as follows:

In IIS, right-click on your /admin folder, and select Properties. In the Directory tab, make sure you have the following configuration:
* Check the radio button labeled "The designated directory"
* Check the checkbox marked "Read"
* Set "Execute Permissions" to "Scripts only"


From the tab "Directory Security", click the Edit button next to "Anonymous access and authentication control". Inside the appearing window:
* Check the checkbox "Anonymous access"
* Check the checkbox "Integrated Windows authentication"

Hope this helps!

 
You can tell using Request.ServerVariabiles(parameter)

and instead of parameter you use:
1."PATH_INFO" - current file
2."HTTP_REFERER" - current .ASP file's father

Also you can use other server variables that you can find in MSDN at Request.ServerVariabiles topic

NOTA: All this information is send through the HTTP header of your ASP file.

Hope this helps,:cool: Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top