Forum Moderators: open

Message Too Old, No Replies

Disallowed Path Characters

cant find the solution

         

Andrew Thomas

9:20 am on Mar 25, 2003 (gmt 0)

10+ Year Member



I get the following error in my program:-

Server.MapPath() error 'ASP 0175 : 80004005'

Disallowed Path Characters

/includes/buildpage.asp, line 281

The '..' characters are not allowed in the Path parameter for the MapPath method.

I was told by the software support (cactushop shoppoing cart) to resolve this do the following:

ANSWER
The problem is with the references to include files in CactuShop. It also affects the DSN-less connection which also references a file in a parent folder.

The database issue can generally be overcome by using a DSN connection but there is no easy work-round for the include file issue.

CactuShop uses 'include' files to contain code that is used in several places, for example:

<!--#include file="../includes/functions.asp"-->

This includes our common functions (code for handling routine tasks like running database queries) on each page so they can be used on any page.

However, some hosting companies disable the ability to include files that are in directories above the folder where the main page file resides. There is a potential threat that code in include files could be run by other web sites on the same machine.

Even include files in folders at the same level cannot be used if the host stops parent paths, because the path to a level folder goes up one folder (i.e. to the parent folder) and then back down.

The best solution to this is to ask the hosting company to enable pages to allow include files in parent folders (directories).

Alternatively, you could modify the CactuShop pages to use virtual include paths rather than relative file paths. Assuming you were running CactuShop on the route of your web, you'd then replace all occurrences of this:

#include file="../includes/

with this:

#include virtual="/includes/

There are many search/replace utilities available for free on the web that can go through the whole of CactuShop and make this change easily.

Note that the virtual path will need to be adjusted if you run CactuShop in a folder on your site.

-------------------------------------------
I did this but still get the error?

my ODBC connection looks like this

'MS Access OLEDB Connection String
pathtodatabase = "/data/mydata.mdb"
databasepassword = "mypassword"
datasourcename = "mydsnname"

Any ideas how to solve this error

thanks

Andrew Thomas

2:46 pm on Mar 25, 2003 (gmt 0)

10+ Year Member



any ideas?

aspdaddy

3:14 pm on Mar 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you still get the same error or a cannot find database error?

I'v never come across this:
#include file="../includes/

IMO it should certainly be
#include virtual="includes/

This looks for the data folder in the root
Server.MapPath("/data/myDb.mdb")

This will look for it in the current folder
Server.MapPath("data/myDb.mdb")

Sorry, not definate answers, its just a case of debugging thier code.