Solved

Getting permission denied error when writing to TXT file in ASP

Posted on 2011-02-16
3
278 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 34

Assisted Solution

by:Paul MacDonald
Paul MacDonald 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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