.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Access denied to folder in ASP.NET project either though I have granted all users full permissions !

Posted By:      Posted Date: August 25, 2010    Points: 0   Category :ASP.Net


i have made a very simple file upload app, that i want users to be able to upload images to a folder on my server, well localhost for the time being Stick out tongue

here is the simple upload code...

        protected void ButtonRegisterDetails_Click(object sender, EventArgs e) 
            // display properties of the uploaded file 

View Complete Post

More Related Resource Links

How to restrict folder access to users and theirs only


Hi. I created a web application using "Forms Authentication". 

There is a folder name "uploads", and it creates subfolders as username when they register. Web application stores users' files and images under their folder ("uploads/username")

I tried to find a way to restrict users to download and upload files to their folder only and couldn't find a good one. 

Then I came up with this idea that stores "web.config" file each time user registers and the web.config should look like below. Username will be changed dynamically according to username.

This method actually works but I am little worried if this is a good practice as far as performance wise. Because it'll create web.config files as many as users and there might be other holes that I don't recognize. 

I appreciate any advice or better suggestion for this problem.

--------web.config in "/Root/uploads/username directory"--------------

<location path="HRpages">

"Only their own" allows users to edit, then shows access denied page

I am managing a WSS 3.0 portal.  I have created custom lists where a group has contribute permissions.  Under List Settings|Advanced Settings, when I set Edit Access to "Only their own" or "None", my test users can see the Edit Icon and the Edit Item menu option, and bring up the Edit Form.  When they click "OK", they get the Access Denied page.  My experience in that past is that they should not even been shown the option to edit, and they should get Access Denied if they somehow navigate to the EditForm.aspx page.  I even tested this on a brand new site, with three Links lists, each with different Edit Access Levels (All, None, Only their own).  I added one user with contribute permissions.  He had the same result: He could get all the way to EditForm.aspx, but got "Access Denied" when he submitted his changes.  What can I do to fix this?Christopher W. Douglas

All Users (Including Site Collection Admins) receiving Access Denied from one Site Collection

I usually spend my time in the forums answering questions.  But this time I need the help. I’ve got a client who somehow has succeeded in locking EVERYONE out of one of their Site Collections.  Users can authenticate to the site, but get an accessdenied page when you try to access anything in the site collection, including pages served from the _Layouts virtual directory.  The AccessDenied page shows that they are authenticated, but not authorized.  This is true for Site Collection admins and user’s who have been given Grant Full Control via a Web Application Permission Policy.  Central Admin and one other site collection are behaving normally.  I've already checked for database permissions - the service account can access the database fine. I've also checked for a locked database or overextended quota.  It's not that either. The accessdenied page url references the users list in the root of the site collection as the offending list denying access.   Does anyone have any ideas?Paul Stork SharePoint Server MVP

Folder inside the List shows Access Denied when try to open using Manage Content Structure

Hi All, We are facing this issue in one of our site, when accessing the folder from Manage content structure. Folder is inside a list which uses a folder content type. When we try to open this folder use manage content and structure it throws access denied. any idea how we can check this as we the permissions are properly inherited and all the folders are checked in . Please update what else we can check.   Thanks, Jasjeet SIngh

Access is denied when creating Alert me on a folder level permission is this a known bug?

Hi, A user is getting an Access Denied error when creating an Alert Me on a folder level. The security set to the user is, Read access to the list but without permission to Create an alert, and he has a Contributor access to the folder. The security was perfect, he can't create an alert to a list level, but Alert Me is available on a folder level. When the user clicks on the Alert Me on a specific folder it will bring him to the alert configuration page, BUT, he would get an Access Denied error when hitting the OK(Save) button. Is this a known issue in Item/folder level security? The fact that Sharepoint allows user to see Alert Me function I assume that it should function correctly, but this is not the case. Hope to hear from you guys! TIA!  

LDAP Domain Users Access denied Error


I have a MOSS 2007 test server setup and have configured Forms Based Authentication on Internet site (just an extension of the main portal site) that authenticates via an LDAP Active Directory server. Most of it works. I can import profiles from the LDAP provider and LDAP users can authenticate to the FBA URL.

The problem I'm running into is with LDAP groups and the Role provider. If I add an LDAP users to a Sharepoint permissions group directly, he can log in and access the site with no problems. However, if I instead add a Group from LDAP (which People Picker finds just fine) then members of that group can authenticate, but get the "Access Denied" page for the portal.

Error Access Denied

Current User
You are currently signed in as:  esmu


The relevant portions of my web.config (I have entered these into the web.config for the main portal site, the extended site for forms based authentication, and the Central Management server site (making the required change for the default role provider for the central management site): i follow these steps:

Help needed! Access denied for the root site for all users except Site Collection Administrators?!


We had implemented an intranet for a customer. Last week on friday we completed the project and they were allowed access to it. Next monday they had done some changes while trying to learn SharePoint (among others the Site Members groups had been deleted) and since then they have been unable to access the root site (e.g. http://intradev/default.aspx) and get a SharePoint Access Denied message. While the root site fails, users can browse to the subsites (e.g. http://intradev/subsite/default.aspx) and view them just fine.

We've noticed that users that are in the Site Collection Administrators group can view the root site just fine. Due to this, we made an educated guess that users had no permissions on the root web. But explicitly adding permissions to the root web does not work. The logon still fails. While it doesn't work in the root web, the permissions are inherited to all subsites, and users can log on and browse those pages just fine.

I've checked pretty much everything. I've tried giving permissions to users in the root site. I've ensured in Central Admin that 'Full Control' does actually give full control of everything. Only thing I've not yet tried is restoring the content database to an earlier backup, where the site was working nicely. 

I'm totally confused by this problem. If you've got any ideas or have encountered a similar

TreeView in Web Part required webctrl_client folder to have atlease read access for all users


HI All

I am using the TreeView control from the Microsoft.Web.UI.WebControls Namespace to render a treeview in a SharePoint web part. The tree nodes images do not appear (text is rendered) properly until i grant atleast read permissions to Authenticated Users on the webctrl_client folder which has to be places in the web application's virtual directory.

Is there some way I can avoid granting the read permission on that folder to all authenticated users.

If i go ahead with the approach of giving the authenticated users rad permission, will a user loggedin via FBA get the read permission

Thanks in Advance

IIS 7 & W2K8 - Access to path \\remotewinXP\folder\ is denied. No error on IIS 6 & W2K3 hosting. Any



Appreciate if someone could point to the right answer on how to overcome this error. By clicking the Button3, the ExportedFilePDF.pdf should be copied to the \\presario remote machine. So far, no security issue on the same configuration in IIS6 + W2K3.

  Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
            File.Copy("C:\BackOffice\Export\ExportedFilePDF.pdf", "\\presario\FaxServer\Outbox\ExportedFilePDF.pdf", True)
        Catch ex As Exception
            Response.Write("Error copying file | " & ex.ToString)
        End Try

    End Sub

 The browser will generate this error message when the Button3 is clicked.

Error copying file | System.UnauthorizedAccessException: Access to the path '\\presario\FaxServer\Outbox\ExportedFilePDF.pdf' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite) at Test5.Button3_Click(Objec

Image Upload Fails- access denied to folder


i am trying to use a fileopen dialog to select an image and copy it to my project folder .

i have used this code to do that.

OpenFileDialog ofd = new OpenFileDialog();
      ofd.Filter = "All Image Files| *.*";
          imgImagePath.Source=new BitmapImage(new Uri(ofd.FileName,UriKind.RelativeOrAbsolute));
          FileStream fs = new FileStream(ofd.FileName,FileMode.Open,FileAccess.Read);
          FileStream copyfs = new FileStream(@"../../Themes/Images", FileMode.CreateNew, FileAccess.Write);

The Error i am gettin is The so and so folder access is denied.

I have check that the folder is not read only. and its in d:

Any suggestions?


Access Denied error when i try to create a text file using vc++ project.



I have vc++ API project which  installes custom tool bar to adobe acrobat. I need to add a text file using this project. when i try to do it it's working in my computer, but when i run this api in another computer, it's giving access denied.

I am using Windows 7 and Visual Studio 8 for this project.

Please can any one give a suggestion or any other method to solve this issue.


Intermittent Access Denied to Users with Member Permission Levels


Hello Community,


I have another tough SharePoint mystery I am trying to solve.  Essentially, users with Member permission levels are experiencing issues accessing a sub-site of a Site Collection intermittently. Users will Full Control, Site or Farm Collection Administrator access do not experience this issue. When the Site Owner with Full Control permission levels opens the site in the morning then the users with Member permission levels are able to access and navigate the sub-site without issue.  Does anyone have any thoughts on what this type of problem may be related to?





Tom Molskow SharePoint Architect - If I solved the issue please propose my reply as the answer - Thanks!

Users with contribute or full control permissions cannot create pages


I've got a problem where users with Contribute permissions or higher - even Full Control (!) - on a site collection cannot create pages.

Site Collection Administrators can create pages fine.

The only way I can get users to create pages is to give them all Contribute permissions to the Master Page Gallery.

The Master Page Gallery, by default, does not inherit permissions from its parent site, it's default out of the box set-up is this:

Approvers  - SharePoint Group  - Read 
Designers - SharePoint Group  - Design 
Hierarchy Managers - SharePoint Group - Read 
Restricted Readers - SharePoint Group - Restricted Read 
Style Resource Readers - SharePoint Group - Read 

Usually having contribute permissions or even full permissions to a site allows you to create a page without having to change the Master Page Gallery's permissions from the above default - we even have site collections which have these settings and work fine.

I don't want to give people unnecessary access to the Master Page Gallery - is there anything else which could be causing this issue?

Users who do not have permissions to access InfoPath 2007 web based form can view the form if someon


I have a SharePoint Form Library with an InfoPath form published to the form as the default template. The form library has several forms in it that have line item permissions. This is supposed to restrict who can view the form. If the user who has had their permissions removed navigates to the form through SharePoint the form does not display (this is expected behavior). However if the user is provided a link to the URL for the form then the can view the InfoPath form.

Here is an example of the link: http://moss.companyname.com/test/_layouts/FormServer.aspx?XmlLocation=/test/InfoPath%20Test/system2009-10-23T12_23_13.xml&Source=http%3A%2F%2Fmoss%2Ecompanyname%2Ecom%2Ftest%2FInfoPath%2520Test%2FForms%2FAllItems%2Easpx&DefaultItemOpen=1

In addition I tried to put the forms into a folder and restirct the permissions on the folder, but the restricted users can still view the form.

When I removed the users permission to the form library then they got an error message.

I also tested this with a SharePoint list item and restricted permissions and this did not allow the user to view the item.


Access denied for anonymous users on list webparts



I have problem with list webparts on Sharepoint foundation web site with anonymous access allowed.

Here is the configuration:

1. Sharepoint Foundation on win 2008 r2 server in standalone mode.

2. Anonymous access is allowed on the web site

3. All permissions are inherited from the top level site (anonymous users have reading allowed)

4. I've created custom xsl templates for rendering list content. They are all stored in Site Assets Library

5. I've added standard OOB list webparts to my webpart pages and linked those webparts to my custom xsl files.

6. everything works fine

7. But when I do an iisreset and try to reach my webpart page as anonymous user I get: "access denied. you do not have permission to perform this action or access this resource." error

8. When authenticated user visits problematic page everything is fine for anonymous user too. (Visiting page as authenticated user is enough)

9. While I'm receiving an error, when I try to access xsl file it shows up in a browser so the xsl file itself is accessible.

Anyone has an idea? There is no custom code here or some references it is just plain old list web part with xsl file.

It looks like cache problem but I'm not sure

Drasko Popovic

Access Denied error when i try to create a text file using vc++ project.



I have vc++ API project which  installes custom tool bar to adobe acrobat. I need to add a text file using this project. when i try to do it it's working in my computer, but when i run this api in another computer, it's giving access denied.

I am using Windows 7 and Visual Studio 8 for this project.

Please can any one give a suggestion or any other method to solve this issue.


Browser based InfoPath Form - fully trusted gives Access denied Error for few users


We have a code-based (code behind) browser based Infopath form which is fully trusted, but it gives out an Access denied error for some users.


The InfoPath form is not digitally signed. Let us know if this has to be done and what is the process for the same for DEV, STAGING and PRODUCTION.




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend