Hi Jeff
Sorry for the typo error
I am using the following folder structure:
c:\website\root\files\foo.asp
c:\website\root\configfiles\1\foo.txt
Virtual directories:
The website in IIS is mapped to c:\website
/Root points to c:\website\root
/Root/Config points to c:\website\configfiles\1
In foo.asp there is code that tries to access foo.txt by using
Server.MapPath(/Root/Files/../Config/) to map the file folder.
In IIS 6.0 (Windows SBS 2003):
1. Server.MapPath(/Root/Files/../Config/) returns c:\website\root\config
(wrong)
2. Server.MapPath(/Root/Config/) returns
c:\website\root\configfiles\1 (correct)
In IIS 5.0 (Windows 2000) both return the same correct result (2)
I am now using option 2 so I can continue my work, but I'd like to
understand what's wrong with my original code.
The ParentPath option is set in both IIS 5 and IIS 6
Thanks for your help,
Elie Grouchko
"Jeff Cochran" <je*********@zina.com> wrote in message
news:41***************@msnews.microsoft.com...
On Sat, 1 Jan 2005 19:02:44 +0200, "Elie Grouchko"
<eg*******@hotmail.com> wrote:
Hi
I am running exactly the same ASP code on IIS 5.0 and IIS 6.0
I am calling Server.MapPath(), the parameter is a virtual path that
includes
a reference to a parent path ("Root/Files/../Config/"). 'Config' is a
virtual directory under 'Root' which is also a virtual directory. 'Files'
is
a normal folder.
Under IIS 5.0, the path is correctly mapped to the local path of the
'Config' virtual directory.
Under IIS 6.0, the path gets mapped to "C:\WebSite\Root\Files\..\Config",
ignoring the 'Config' virtual directory mapping.
Is there a special setting I should be aware of in IIS 6.0 to ensure
correct
mapping of virtual paths?
Shouldn't that be Server.MapPath("/Config") ? It's a virtual folder
under the root, if you wanted to get to the folder in a url you'd use
http://{host}.{Domain}.{TLD}/Config/ so that's where the MapPath
should point.
Jeff