473,785 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(f ullpath);
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 1720
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************ ****@discussion s.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);
DirectoryInf o dir = new DirectoryInfo(f ullpath);
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
21112
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 http://www.asp101.com/articles/jacob/scriptupload.asp. I copied to my wwwroot folder on my Win2000AS/SP4 server: - main .asp file
4
18933
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 and settings are required for creating and writing the event logs on the system.
0
1225
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, including the development machine are running on the same windows user account. On the development machine, the app works great. The other client machines run into directory permission problems when attemptiong to browse the directory the images are...
3
8249
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() Traceback (most recent call last): File "<stdin>", line 1, in <module>
4
12831
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 E:\webroot\dev\file_test\index.php on line 416 My script basically reads email attachments and downloads the attachment file into the current directory of the running script. The data in the attachements is then read and stored into MySQL. Once i've finished reading...
1
3569
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 permission denied problem. Warning: fopen(/var/www/html/dotproject/files/temp/temp1.pdf): failed to open stream: Permission denied in /var/www/html/dotproject/modules/projects/reports/tasklogs.php on line 307 Could not open file to save PDF. ...
0
3405
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 installed same application on another server Win 2003 R2 Std (No Active Directory). On that server I get “Permission denied” using the following code (used to zip folder content).
0
1219
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 installed same application on another server Win 2003 R2 Std (No Active Directory). On that server I get “Permission denied” using the following code (used to zip folder content). set WshShell = server.createobject("wscript.shell")
0
1859
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 and is (obviously) specific to that user. You may -- depending on your needs -- also not need the suffix & prefix. ie, unless you have some specific need in mind, just use:
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.