Solved

Getting permission denied error when writing to TXT file in ASP

Posted on 2011-02-16
3
274 Views
Last Modified: 2012-05-11
I am trying to execute the code below from a web page on an IIS server to record the responses that a user enters into the page.

I get an error "800a0046" which when I Googled says permission denied.

At this point I am running this from localhost as an admin on the box. I have tried writing to C:\ and C:\inetpub\wwwroot. Any ideas?


thanks,
ob1
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject") 
set f=fs.CreateTextFile("c:\inetpub\wwwroot\test.txt",true)
f.write("Hello World!")
f.write("How are you today?")
f.close
set f=nothing
set fs=nothing

Open in new window

0
Comment
Question by:ob1_
3 Comments
 

Accepted Solution

by:
jtlowe22 earned 250 total points
ID: 34908568
I'm not sure what's going on but make sure your ASP.Net application has write access to the directory you are trying to save the file to.
0
 
LVL 33

Assisted Solution

by:paulmacd
paulmacd earned 250 total points
ID: 34908572
I'm surprised it doesn't work for you locally, but you can try giving permissions to the aspnet_wp account for the folder you want to write to and see if that helps.
0
 
LVL 6

Author Closing Comment

by:ob1_
ID: 34908640
i gave permissions to IUSR and IUSRS group and used "GetFolder" method to specify folder as well as text file. this seems to work.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now