473,699 Members | 2,811 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 1655
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
14317
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
1929
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
1602
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, 'Server.MapPath' turns into an error "Name 'server' is not declared"
7
3387
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
12718
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 as if it were in "C:\Inetpub\wwwroot\MyApp\VirtualFolder".
5
9621
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 internal Visual Studio 2005 Server I receive an error for
4
7188
by: vunet.us | last post by:
How to use server.mappath() parent folder correctly: Server.MapPath("../test.asp") Thank you for the hint.
3
15063
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")) & Response.Write(Request.MapPath("Hello.aspx"))
6
7940
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 physical root on my intranet server?
3
4124
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
8706
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8633
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8947
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8902
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5891
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4392
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3076
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2366
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2016
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.