views:

28

answers:

1

I have a file that is being included, in that file there's
Server.MapPath('../_data") which doesn't work
since that file included is not in the same Server.MapPath as the file executed.
any Idea of how I can get the included file's path?


To clarify the situation, I added a picture alt text



As you can see, I'm including a file from one site to the other
(no other choice there), so that the server.mappath is intended to be different, though
the result is that on the included file I get the mappath of the executed file.

A: 

You should better use relative paths.

Relative paths start with / which means start from the root of the site..

Gaby
actually, I AM using a relative path, the thing is , I'm using SaveToFile server.mappath("../data") and it tries to save on the path EXECUTEDFILESERVER/data instead of the INCLUDEDFILESERVER/data (the included file is in another directory, and should return a different mappath) http://imgur.com/Ues2e.png
Asaf
@Asaf, hmmm i do not think you can do it, if you include from another site.. the running site would not have access to the other one.. Maybe you could create some sort of service that you can query with an `MSXML2.ServerXMLHTTP` request, in order to get the final data from that server..
Gaby
oh the including of the file is possible, and it does work... because the folder structure is such to let me access it through ../../site2...... so that's not the issue
Asaf
what are you doing with the included file ? if it is self-contained, and it just runs some code and creates output, your could perhaps use the `server.execute` method
Gaby