Cannot use a leading .. to exit above the top directory.

S

Simon Harris

Hi All,

I'm trying to access a folder stored below the root of my site called
'private', which is where my host recommend storing application data.

When I do a server.mappath on ../../private, I get this error:

Cannot use a leading .. to exit above the top directory.

This is happening in the following page:
/contenteditor/index.aspx

So, ../../private should equate to a folder called 'private' one folder
below the root, right?

Thanks!
Simon.
 
Y

Yunus Emre ALPÖZEN [MCAD.NET]

try to use Server.MapPath("~/private"). It is more reliable. What will
happen when u add another subdirectory... Server.MapPath("~/private") will
still works.
 
J

Juan T. Llibre

The MapPath method maps a relative or virtual path to a physical path.

You cannot use the Server.MapPath method to map a path
which is outside the virtual directory's scope.

Use a physical path instead.
If you're trying to access a database, create a DSN and use that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top