Forum Moderators: open

Message Too Old, No Replies

Error with IIS 6 - Server.MapPath() error , Disallowed Path Characters

Disallowed Path Characters

         

newcinc

8:38 am on Jun 22, 2003 (gmt 0)

10+ Year Member



I'm using Windows 2000 Advanced Server and IIS 5 to write my Web Application. In each page contain:

----------------------------------------------------
Server.MapPath("../db/dbfile.mdb")
----------------------------------------------------

and it run corectly in IIS 5.

But today, I setup Windows Server 2003 (Web Editor), so, IIS I'm using is: IIS 6. And my project can not run because this Error:

----------------------------------------------------
Server.MapPath() error 'ASP 0175 : 80004005'
Disallowed Path Characters
/index.asp, line 2
The '..' characters are not allowed in the Path parameter for the MapPath method.
----------------------------------------------------

Please let me know how to fix this error.
Thank you so much.

sharbel

1:03 pm on Jun 22, 2003 (gmt 0)

10+ Year Member



I think this is a new security feature in IIS6.. I recall a post on an MS board asking about this. Aparently IIS6 doesnt want you using (..)

mattur

2:11 pm on Jun 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure whether this applies to IIS6, but this could be due to having "Enable Parent Paths" turned off -

"Select this check box to allow ASP pages to use relative paths to the parent directory of the current directory (paths using the .. syntax)."

newcinc

2:39 pm on Jun 22, 2003 (gmt 0)

10+ Year Member



Dear mattur,

Please let me know how to turn on "Enable Parent Paths"

I finding in IIS but could not see where it was.

In IIS6, somesite which run correctly in IIS 5 could not running. (Althought it have no ".." syntax in include or Mappath..)

Anyone who experience in solving this problem, please help me..

Thanks

mattur

2:44 pm on Jun 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I haven't got access to iis6, but in iis5 you go into IIS in admin tools, go into web site properties, click the Home directory tab, then configuration, then the options tab. HTH

newcinc

2:48 pm on Jun 22, 2003 (gmt 0)

10+ Year Member



Dear mattur,
Thanks for your helping. My problem was resolved (Mappath... and Some other problems included...)

Thanks again...

:-)

sharbel

8:19 pm on Jun 22, 2003 (gmt 0)

10+ Year Member



hehe post the resolution to your problem so people who have the same problem can benefit :)