473,408 Members | 2,025 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,408 software developers and data experts.

Dynamically created directory not recognized by web server

With XPpro, I am programmatically creating sub-folders within the virtual
directory of my app. I programmatically set read/write permissions and then
successfully write some files to the directory. All of this works fine.

But when I try to browse the new directory through IE, it does not see it.
The error message is:
HTTP 403.1 Forbidden: Execute Access Forbidden
Internet Information Services

The code to create the directory is:

Dim fullPath As String = Request.PhysicalApplicationPath &
"userResources\" & newUserDir
Dim di As DirectoryInfo = New DirectoryInfo(fullPath)
di.Create()

' now to set the permissions
Dim f2 As New FileIOPermission(FileIOPermissionAccess.Read,
fullPath)
f2.AddPathList(FileIOPermissionAccess.Write Or
FileIOPermissionAccess.Read, fullPath)
The directory structure is this (where dir1 is the dynamically created dir):
c:\iNetpub\wwwRoot\myApp
c:\iNetpub\wwwRoot\myApp\userDirectories\dir1
c:\iNetpub\wwwRoot\myApp\userDirectories\dir1\grap hic_that_wont_display.gif
Nov 19 '05 #1
1 1478
You are misunderstanding the function of the FileIOPermission class.
FileIOPermission is used to declare what parts of the file system your
code should be allowed to access. It is part of the .NET code access
security model. It has nothing to do with changing the ACL's on the
file system.

In .NET 1.0/1.1, I don't believe there is any built in way to manipulate
file system ACLs (there will be in .NET 2.0). You will have to do it
through P/Invoke calls to the Win32 API. I don't think it is simple,
but you can probably find examples on the net.
Joshua Flanagan
http://flimflan.com/blog

encapsul wrote:
With XPpro, I am programmatically creating sub-folders within the virtual
directory of my app. I programmatically set read/write permissions and then
successfully write some files to the directory. All of this works fine.

But when I try to browse the new directory through IE, it does not see it.
The error message is:
HTTP 403.1 Forbidden: Execute Access Forbidden
Internet Information Services

The code to create the directory is:

Dim fullPath As String = Request.PhysicalApplicationPath &
"userResources\" & newUserDir
Dim di As DirectoryInfo = New DirectoryInfo(fullPath)
di.Create()

' now to set the permissions
Dim f2 As New FileIOPermission(FileIOPermissionAccess.Read,
fullPath)
f2.AddPathList(FileIOPermissionAccess.Write Or
FileIOPermissionAccess.Read, fullPath)
The directory structure is this (where dir1 is the dynamically created dir):
c:\iNetpub\wwwRoot\myApp
c:\iNetpub\wwwRoot\myApp\userDirectories\dir1
c:\iNetpub\wwwRoot\myApp\userDirectories\dir1\grap hic_that_wont_display.gif

Nov 19 '05 #2

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

Similar topics

1
by: Malkalypse | last post by:
Hello, I have been having some trouble with this one, so I decided to strip it down to its simplest form. I think I found the root of the problem, but I don't know how to solve it. I need a link...
3
by: Dmitry Korolyov [MVP] | last post by:
Is that possible? In other words, I want a dropdown list (and other list-type controls) which appears in edit more of a templated column to be populated with data at the run time. An attempt to do so...
0
by: mawi | last post by:
Hello, Description: I create panels with some controls on a page using a new panel button. One of the controls on each panel is the "close panel" button that is supposed to close the panel it...
7
by: Ryan Taylor | last post by:
Hi. I have some code that dynamically generates a PDF and spits this content directly to the web browser. I use HTMLDoc to create the Pdf's from html. So the user can click on a button "Print...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
5
by: Amelyan | last post by:
How can I get state of dynamically created controls (RadioButton, CheckBox, TextBox.Text) on post back when I click submit button? The only way I know is by traversing Response.Form enumberator;...
1
by: Marcus | last post by:
I have a problem maybe one of you could help me with. I've created a data entry screen with lots of dynamically-created client-side controls. I create HTML texboxes client-side by assigning a...
2
by: D Hass | last post by:
Radio Buttons are added to my form During the Load event, the quantity determined by User input. They are placed in pairs on groupboxes with code like this: (edited a bit for brevity) Public...
4
by: Dica | last post by:
i need to dynamically add a web control to a page without using placeHolder. i'm looping through all the files in a folder and creating a table row as string for each file. the contol is to be...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.