Cannot use a leading .. to exit above the top directory.

Discussion in 'ASP .Net' started by Simon Harris, May 8, 2005.

  1. Simon Harris

    Simon Harris Guest

    Hi All,

    I'm trying to access a folder stored below the root of my site called
    'private', which is where my host recommend storing application data.

    When I do a server.mappath on ../../private, I get this error:

    Cannot use a leading .. to exit above the top directory.

    This is happening in the following page:
    /contenteditor/index.aspx

    So, ../../private should equate to a folder called 'private' one folder
    below the root, right?

    Thanks!
    Simon.


    --
    I am using the free version of SPAMfighter for private users.
    It has removed 2167 spam emails to date.
    Paying users do not have this message in their emails.
    Try www.SPAMfighter.com for free now!
     
    Simon Harris, May 8, 2005
    #1
    1. Advertising

  2. try to use Server.MapPath("~/private"). It is more reliable. What will
    happen when u add another subdirectory... Server.MapPath("~/private") will
    still works.

    --

    Thanks,
    Yunus Emre ALPÖZEN
    BSc, MCAD.NET

    "Simon Harris" <> wrote in message
    news:...
    > Hi All,
    >
    > I'm trying to access a folder stored below the root of my site called
    > 'private', which is where my host recommend storing application data.
    >
    > When I do a server.mappath on ../../private, I get this error:
    >
    > Cannot use a leading .. to exit above the top directory.
    >
    > This is happening in the following page:
    > /contenteditor/index.aspx
    >
    > So, ../../private should equate to a folder called 'private' one folder
    > below the root, right?
    >
    > Thanks!
    > Simon.
    >
    >
    > --
    > I am using the free version of SPAMfighter for private users.
    > It has removed 2167 spam emails to date.
    > Paying users do not have this message in their emails.
    > Try www.SPAMfighter.com for free now!
    >
    >
     
    Yunus Emre ALPÖZEN [MCAD.NET], May 8, 2005
    #2
    1. Advertising

  3. The MapPath method maps a relative or virtual path to a physical path.

    You cannot use the Server.MapPath method to map a path
    which is outside the virtual directory's scope.

    Use a physical path instead.
    If you're trying to access a database, create a DSN and use that.




    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Simon Harris" <> wrote in message
    news:...
    > Hi All,
    >
    > I'm trying to access a folder stored below the root of my site called
    > 'private', which is where my host recommend storing application data.
    >
    > When I do a server.mappath on ../../private, I get this error:
    >
    > Cannot use a leading .. to exit above the top directory.
    >
    > This is happening in the following page:
    > /contenteditor/index.aspx
    >
    > So, ../../private should equate to a folder called 'private' one folder
    > below the root, right?
    >
    > Thanks!
    > Simon.
    >
    >
    > --
    > I am using the free version of SPAMfighter for private users.
    > It has removed 2167 spam emails to date.
    > Paying users do not have this message in their emails.
    > Try www.SPAMfighter.com for free now!
    >
    >
     
    Juan T. Llibre, May 8, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    1
    Views:
    3,758
    Ken Schaefer
    Dec 11, 2003
  2. Nathan Sokalski
    Replies:
    5
    Views:
    3,563
    Sergey Polyakov
    Jun 6, 2005
  3. moondaddy
    Replies:
    2
    Views:
    3,997
    =?Utf-8?B?VEJERVY=?=
    Jan 12, 2006
  4. webonomic
    Replies:
    1
    Views:
    5,616
    webonomic
    Jan 20, 2006
  5. Nathan Sokalski

    Error: Cannot use a leading .. to exit above the top directory.

    Nathan Sokalski, May 30, 2005, in forum: ASP .Net Building Controls
    Replies:
    5
    Views:
    247
    Sergey Polyakov
    Jun 6, 2005
Loading...

Share This Page