server.mappath

Discussion in 'ASP General' started by Web Search Store, Oct 8, 2005.

  1. Hello,

    I'm trying to use the server.mappath function on a web site hosted on win
    2000 professional.

    Is this feature not on win 2000 pro?

    It simply produces 'page not found'

    Thanks for any help

    It is in an asp page, with code like this:


    countdb="data\searchrequests.txt"
    mydsn6= server.mappath(countdb)


    Thanks for any help.

    Scott Baxter
     
    Web Search Store, Oct 8, 2005
    #1
    1. Advertising

  2. Web Search Store

    Curt_C [MVP] Guest

    just for a test, try Server.MapPath("./") and see what DIR it returns....
    Most likely you are hitting the wrong path.

    That command is there in Win2k's IIS.

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com


    "Web Search Store" <> wrote in message
    news:...
    > Hello,
    >
    > I'm trying to use the server.mappath function on a web site hosted on win
    > 2000 professional.
    >
    > Is this feature not on win 2000 pro?
    >
    > It simply produces 'page not found'
    >
    > Thanks for any help
    >
    > It is in an asp page, with code like this:
    >
    >
    > countdb="data\searchrequests.txt"
    > mydsn6= server.mappath(countdb)
    >
    >
    > Thanks for any help.
    >
    > Scott Baxter
    >
     
    Curt_C [MVP], Oct 8, 2005
    #2
    1. Advertising

  3. Web Search Store wrote:
    > Hello,
    >
    > I'm trying to use the server.mappath function on a web site hosted on
    > win 2000 professional.
    >
    > Is this feature not on win 2000 pro?
    >
    > It simply produces 'page not found'
    >
    > Thanks for any help
    >
    > It is in an asp page, with code like this:
    >
    >
    > countdb="data\searchrequests.txt"
    > mydsn6= server.mappath(countdb)
    >
    >

    server.mappath returns a physical file path (the path you would use in
    Windows Explorer, not IE). It should not be used in a situation where a url
    is needed ("page not found" results from an invalid url, not an invalid
    physical file path). Why don't you show us how you are attempting to use
    mydsn6 - that will probably provide the answer to your question.
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Oct 8, 2005
    #3
  4. Web Search Store

    Evertjan. Guest

    Web Search Store wrote on 08 okt 2005 in
    microsoft.public.inetserver.asp.general:

    > It is in an asp page, with code like this:
    >
    >
    > countdb="data\searchrequests.txt"
    > mydsn6= server.mappath(countdb)
    >


    While possible, isn't it a bit strange to set a relative path here,
    as you probably don't know the current directory
    the ASP executable has "in mind".

    Better use an absolute path:

    countdb="c:\myDir\data\searchrequests.txt"
    mydsn6= server.mappath(countdb)


    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Oct 8, 2005
    #4
    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,261
    Scott M.
    Jan 17, 2010
  2. Peter Row
    Replies:
    0
    Views:
    478
    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,179
    Juan T. Llibre
    Mar 11, 2007
  4. Replies:
    4
    Views:
    994
    Juan T. Llibre
    Oct 7, 2007
  5. AAaron123
    Replies:
    11
    Views:
    1,208
    AAaron123
    Sep 9, 2009
Loading...

Share This Page