Server.MapPath bug?

J

jamting

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?
 
E

Evertjan.

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.
 
J

Jevon

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

Jevon
 
J

jamting

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
 
J

Jevon

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


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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top