Solved

Getting permission denied error when writing to TXT file in ASP

Posted on 2011-02-16
3
275 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 Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ADO.NET ENTITY DATA MODEL 3 31
consuming an asmx web service in winforms application 3 24
IP API - need data... 4 13
Issues with Insert statement 12 14
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

17 Experts available now in Live!

Get 1:1 Help Now