473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Permission denied creating directory

Hi,

I have a created a simple file upload asp.net web page which also creates directories on the fly using the following code:

string fullpath = Server.MapPath(".\\..\\..\\" + path);
DirectoryInfo dir = new DirectoryInfo(fullpath);
if(!dir.Exists)
dir.Create();

Now the dir.Create() statement gives me a permission denied. The ASP.NET user has been giving full control to the directory and in IIS Admin the directory has write permissions for scripts set. There is no problem in uploading the file to an already created directory which I find extremely weird!

What goes wrong ?

My OS is Windows XP using .NET framework 1.1. All the latest security patches are installed.
Nov 18 '05 #1
2 1704
Hi Christoffer:

One way to trouble shoot these types of problems is to enable auditing
and find out "who" is getting the access denied message.

See:
http://www.pluralsight.com/keith/boo...eauditing.html
and
http://www.pluralsight.com/keith/boo...ileaccess.html

Also, make sure the permissions apply to subfolders - click "Advanced"
and check the "Apply To" column.

HTH,

--
Scott
http://www.OdeToCode.com

On Mon, 21 Jun 2004 08:25:40 -0700, Christoffer Sørensen
<Ch****************@discussions.microsoft.com> wrote:
Hi,

I have a created a simple file upload asp.net web page which also creates directories on the fly using the following code:

string fullpath = Server.MapPath(".\\..\\..\\" + path);
DirectoryInfo dir = new DirectoryInfo(fullpath);
if(!dir.Exists)
dir.Create();

Now the dir.Create() statement gives me a permission denied. The ASP.NET user has been giving full control to the directory and in IIS Admin the directory has write permissions for scripts set. There is no problem in uploading the file to an already created directory which I find extremely weird!

What goes wrong ?

My OS is Windows XP using .NET framework 1.1. All the latest security patches are installed.


Nov 18 '05 #2
"Scott Allen" wrote:
One way to trouble shoot these types of problems is to enable auditing
and find out "who" is getting the access denied message.
See:
http://www.pluralsight.com/keith/boo...eauditing.html
and
http://www.pluralsight.com/keith/boo...ileaccess.html
Thanks for these links.
Also, make sure the permissions apply to subfolders - click "Advanced"
and check the "Apply To" column.


I have found what the problem was. The ASPNET user I added was from another domain. Now I have added the local ASPNET user and it works.

The audit thing really helped. Thank you very much!

Kind regards,

Christoffer Sørensen
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Richard Muller | last post by:
Hi, I new to ASP. I have a problem with an ASP script opening a file for writing on my server. Here's how I got to this error: I downloaded a neat FileUpload ASP example from...
4
by: Sachin | last post by:
Hi All, I am trying to create and write to Event Log on Windows Server 2003 system in a simple C# application. However, it throws the exception saying that Access is denied. What permission...
0
by: Jeremy | last post by:
I have an ASP.net application which needs to retreive images from multiple remote machines. It is reterieveing images generated by a web cam service on those machines. All of these machines,...
3
by: John Machin | last post by:
Hi, Here's what's happening: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) on win32 Type "help", "copyright", "credits" or "license" for more information. | >>import os | >>os.tmpfile()...
4
by: nitinpatel1117 | last post by:
Hi I am trying to delete a csv file using the unlink() function, but i keep getting a permission denied warning Warning: unlink(UsedNOS200704191.CSV): Permission denied in...
1
by: doctorhardik | last post by:
other interesting thing i observe during my work which i describe below: i am using dotproject2.0.4 on fc3. it is working fine. but i want to generate pdf file report during this time i face...
0
by: private.anders | last post by:
Hi David! Really need assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: private.anders | last post by:
Really need your assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: Tim Golden | last post by:
aditya shukla wrote: Why on earth are you *specifying* c:\python25 as the directory for this file? It's automatically created in your user-specific temp directory which has specific permissions...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.