Server.MapPath

Discussion in 'ASP.NET / ASP.NET Core' started by bmacdonald, Mar 9, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. From the root folder of an application, I tried Server.MapPath to a folder above my application. I want more than one application to access the same database. I got the error "Cannot use a leading ../ to exit above the top directory." So can Server.MapPath only map a path within the same application?

    bmacd
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    I think this is a security measure to disallow server mappath to climb back up the directory tree.

    You can use the physical path (found in the account information section in the control panel) instead of using map path.

    Hope this helps


    quote:Originally posted by bmacdonald

    From the root folder of an application, I tried Server.MapPath to a folder above my application. I want more than one application to access the same database. I got the error "Cannot use a leading ../ to exit above the top directory." So can Server.MapPath only map a path within the same application?

    bmacd
    </blockquote id="quote"></font id="quote">
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page