Solved

Getting permission denied error when writing to TXT file in ASP

Posted on 2011-02-16
3
285 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_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

710 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