473,563 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server.MapPath bug?

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\wwwr oot\
D:\inetpub\wwwr oot\

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

c:\inetpub\wwwr oot
c:\inetpub

Any clues?

Jan 18 '06 #1
4 1648
wrote on 18 jan 2006 in microsoft.publi c.inetserver.as p.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\wwwr oot\
D:\inetpub\wwwr oot\

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

c:\inetpub\wwwr oot
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)
Jan 18 '06 #2
Is one set up as an application (on the website properties' Home Directory
tab) and the other not?

Jevon
<ja*****@gmail. com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
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\wwwr oot\
D:\inetpub\wwwr oot\

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

c:\inetpub\wwwr oot
c:\inetpub

Any clues?

Jan 18 '06 #3
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 '06 #4
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
<ja*****@gmail. com> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com...
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 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
14304
by: John Rebbeck | last post by:
I've got the directory f:\Company\Product set as web shared so it's got a virtual directory in the default web site on my test server's IIS. If I try to use Server.MapPath in that site it returns a path within c:\Inetpub\wwwroot rather than the real path. Can anyone please tell me why this isn't working? Regards, John
4
1921
by: Laphan | last post by:
Hi All Sorry to be irate, but the whole concept of Server.MapPaths really has me in a tiswas!! In order to confirm once and for all, could you please advise me on the following: 1) There is no difference in putting '/' or '\' in the Server.MapPath param, eg Server.MapPath("/fred/test.asp") or Server.MapPath("\fred\test.asp") -
6
1596
by: darrel | last post by:
I have some functions that are reading/writing to the file system. As such, they use server.mapPath a lot to navigate it all. Since I'm using these functions numerous times throughout my application, I thought I'd move these into their own .vb class file and reference them that way. The catch is when moving these scripts over,...
7
3379
by: benoit | last post by:
Hi, if I write this code to retrieve a folder on the server Server.mappath("/DATA") I get this error message System.InvalidOperationException: Failed to map the path '/DATA' the virtual folder for my webApp is not situated in Inetpub, nor is the DATA folder that I would like to retrieve
14
12702
by: Lorenzo | last post by:
Hello, I have a web application with a virtual directory in it. With 'virtual directory' i mean a folder whose physical path is different from the physical path of the application, but in which Web Sharing is active. For example: my application is in "C:\Inetpub\wwwroot\MyApp", the Virtual folder is in "C:\VirtualFolder", and IIS sees it...
5
9616
by: MichiMichi | last post by:
When using Server.MapPath on IIS 5 on my localhost everything works well. All of the following commands are executed without any error Response.Write(Server.MapPath("/app_test") & "<br>") Response.Write(Server.MapPath("app_test") & "<br>") Response.Write(Server.MapPath("~") & "<br>") However, running the first statement on via the...
4
7172
by: vunet.us | last post by:
How to use server.mappath() parent folder correctly: Server.MapPath("../test.asp") Thank you for the hint.
3
15053
by: rn5a | last post by:
Server.MapPath returns the physical file path that corresponds to the specified virtual path whereas Request.MapPath maps the specified virtual path to a physical path. Assuming that a file named Hello.aspx resides in C:\Inetpub\wwwroot\MyFolder, the output of both Response.Write(Server.MapPath("Hello.aspx")) & ...
6
7930
by: withers | last post by:
If I run Server.MapPath("/") on my operational Internet server I get, correctly, the physical path to the directory my page is in (d:\.... \...\htdocs). If I run Server.MapPath("/") on my intranet server, my localhost, I get c:\inetpub\wwwroot, but my webpages are NOT in this folder, they are in c:\webtest. How to I establish the correct...
3
4120
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have one line code in my program, occasionaly I will receive the following error: "The Path parameter for the MapPath method did not correspond to a known path" Path=Server.MapPath(sCertPath & "\" & order_id & ".pdf") I am wondering what is happening since every time I check my error log, the
0
7659
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7882
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7634
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7945
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5208
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.