Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server.MapPath not returning expected path

Tags:

asp-classic

I've been handed alegacy (Classic ASP), red headed step child who has been beaten, shot and otherwise maimed by a number of people before my time, application and for the life of me I can't figure out how it's actually working on production (I even got a copy from production just in case the files weren't up to date in source control).

I have code that does the following

tmpDefaultXSLFile="xsl/SomeValue"
...
objXsl.load(Server.MapPath(tmpDefaultXSLFile & ".xsl"))

However, Server.MapPath seems not to map the file to the expected location (i.e."\asp_file_directory\xsl\SomeValue.xsl" and the modification required is to the xsl file.

Is there ANY way that the system could be fooled into have Server.MapPath map somewhere else?

like image 976
Marty Trenouth Avatar asked Apr 23 '26 23:04

Marty Trenouth


1 Answers

server.mappath(Path) specifies the relative or virtual path to map to a physical directory.

If Path starts with either a forward (/) or backward slash (\), the MapPath method returns a path as if Path is a full virtual path.

If Path doesn't start with a slash, the MapPath method returns a path relative to the directory of the .asp file being processed.

like image 96
Dee Avatar answered Apr 27 '26 01:04

Dee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!