Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > server.mappath

Reply
Thread Tools

server.mappath

 
 
Web Search Store
Guest
Posts: n/a
 
      10-08-2005
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


 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      10-08-2005
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
>



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-08-2005
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"


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      10-08-2005
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)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57