Server.MapPath bug?

Discussion in 'ASP General' started by jamting@gmail.com, Jan 18, 2006.

  1. Guest

    Since i reinstalled windows server, i've had a strange behaviour in
    server.mappath.

    for instance this file: test.asp:

    <%
    response.write server.mappath(".") & "<br>"
    response.write server.mappath("..")
    %>

    Returns the following output, when placed in a new root i've set up on
    drive d:

    D:\inetpub\wwwroot\
    D:\inetpub\wwwroot\

    If i however place this file i the default site it returns

    c:\inetpub\wwwroot
    c:\inetpub

    Any clues?
     
    , Jan 18, 2006
    #1
    1. Advertising

  2. Evertjan. Guest

    wrote on 18 jan 2006 in microsoft.public.inetserver.asp.general:

    > Since i reinstalled windows server, i've had a strange behaviour in
    > server.mappath.
    >
    > for instance this file: test.asp:
    >
    > <%
    > response.write server.mappath(".") & "<br>"
    > response.write server.mappath("..")
    > %>
    >
    > Returns the following output, when placed in a new root i've set up on
    > drive d:
    >
    > D:\inetpub\wwwroot\
    > D:\inetpub\wwwroot\
    >
    > If i however place this file i the default site it returns
    >
    > c:\inetpub\wwwroot
    > c:\inetpub
    >


    You cnnot get below the root, because that is not part of the external
    layout.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jan 18, 2006
    #2
    1. Advertising

  3. Jevon Guest

    Is one set up as an application (on the website properties' Home Directory
    tab) and the other not?

    Jevon


    <> wrote in message
    news:...
    > Since i reinstalled windows server, i've had a strange behaviour in
    > server.mappath.
    >
    > for instance this file: test.asp:
    >
    > <%
    > response.write server.mappath(".") & "<br>"
    > response.write server.mappath("..")
    > %>
    >
    > Returns the following output, when placed in a new root i've set up on
    > drive d:
    >
    > D:\inetpub\wwwroot\
    > D:\inetpub\wwwroot\
    >
    > If i however place this file i the default site it returns
    >
    > c:\inetpub\wwwroot
    > c:\inetpub
    >
    > Any clues?
    >
     
    Jevon, Jan 18, 2006
    #3
  4. Guest

    No they´re set up the same, and with parent paths enabled. Initially i
    got the error on a server.execute statement, which i found out after
    some investigation, was fed the wrong relative path. I then isolated
    the error to the two server.mappath statements.

    I found two references in google groups with the same error, but the
    threads started back in 2002 and was never resolved.

    I'm running Windows 2003 server standard with all patches. The only
    thing changed from the previous installation is that i now use the
    swedesh version rather than the english.

    Thanks for your replies and keep them coming :)

    /Mattias
     
    , Jan 19, 2006
    #4
  5. Jevon Guest

    I've just tried it (on an English install) and it works as expected for me.
    Have you tried deleting and recreating the folder and website?

    Jevon


    <> wrote in message
    news:...
    No they´re set up the same, and with parent paths enabled. Initially i
    got the error on a server.execute statement, which i found out after
    some investigation, was fed the wrong relative path. I then isolated
    the error to the two server.mappath statements.

    I found two references in google groups with the same error, but the
    threads started back in 2002 and was never resolved.

    I'm running Windows 2003 server standard with all patches. The only
    thing changed from the previous installation is that i now use the
    swedesh version rather than the english.

    Thanks for your replies and keep them coming :)

    /Mattias
     
    Jevon, Jan 19, 2006
    #5
    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. Jon
    Replies:
    5
    Views:
    11,191
    Scott M.
    Jan 17, 2010
  2. Peter Row
    Replies:
    0
    Views:
    469
    Peter Row
    Mar 1, 2004
  3. =?Utf-8?B?dHBhcmtzNjk=?=

    server.mappath vs. request.mappath

    =?Utf-8?B?dHBhcmtzNjk=?=, Mar 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,163
    Juan T. Llibre
    Mar 11, 2007
  4. Replies:
    4
    Views:
    975
    Juan T. Llibre
    Oct 7, 2007
  5. AAaron123
    Replies:
    11
    Views:
    1,204
    AAaron123
    Sep 9, 2009
Loading...

Share This Page