Access to folder denied.

Unable to get read from App_Data Folder

Page 1 of 1

4 Replies - 2668 Views - Last Post: 23 August 2010 - 11:12 PM Rate Topic: -----

#1 crzyone9584  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 201
  • Joined: 22-April 08

Access to folder denied.

Posted 20 August 2010 - 02:03 PM

I'm using the following tutorial for my navigation system. I like it more than sitemaps and I've been having more trouble with site maps than this way.

Tutorial: Menu with XML DataSource

This is the error I'm getting when I navigate to my published site.

Quote

Access to the path 'C:\Domains\mysite.com\SubDomains\foldername\App_Data\user_menu.xml' is denied.


I replaced my doamin and the folder name.

I'm on a shared hosting server with aspnix. Would it be wiser to just use a different folder, or is there a way to access the App_Data folder?

Is This A Good Question/Topic? 0
  • +

Replies To: Access to folder denied.

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: Access to folder denied.

Posted 21 August 2010 - 05:46 AM

You use Server.MapPath.

So for the App_Data folder, this should work...

string path = Server.MapPath("~/App_Data");


Was This Post Helpful? 0
  • +
  • -

#3 crzyone9584  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 201
  • Joined: 22-April 08

Re: Access to folder denied.

Posted 22 August 2010 - 09:22 AM

I tried that and it still said denied. Then I found a post either here or the asp.net forums that said to put the impersonate tags in the web.config and it worked. How safe is that?
Was This Post Helpful? 0
  • +
  • -

#4 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Access to folder denied.

Posted 23 August 2010 - 06:56 AM

If this is going to be in a production environment, then I would recommend against impersonation. You want to only give enough permissions to ASP.NET to do what it needs and nothing more and depending on the account that you are impersonating you could be providing more access than is necessary.

Understanding ASP.NET Impersonation Security
Was This Post Helpful? 0
  • +
  • -

#5 crzyone9584  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 201
  • Joined: 22-April 08

Re: Access to folder denied.

Posted 23 August 2010 - 11:12 PM

Would adding a web.config with the allow tags fix this with out the impersonate tags? Its late so I'll be reading the article tomorrow between classes.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1