0

I have a web app in a subdomain, where I want to uptain access to a file located in the main domain. Is that possible?

HttpContext.Current.Server.MapPath("../www/file.xml"));

Where "www" in the main folder. The "../" doesnt work.

To be crystal clear. Im trying to load a xml file into a XDocument object:

Data = XDocument.Load(HttpContext.Current.Server.MapPath("~/App_Data/file.xml");

Works fine. But I want the path to be in a folder on the main domain. How can I do that? If its possible :)

Mat
  • 202,337
  • 40
  • 393
  • 406
Kasper Skov
  • 1,954
  • 10
  • 32
  • 53

2 Answers2

2

Then you will have to specify the full url like c:/wwwroot/site/file.xml

Csaba Toth
  • 10,021
  • 5
  • 75
  • 121
Kimtho6
  • 6,154
  • 9
  • 40
  • 56
0

Or you can just create a symlink (mklink command in cmd) and use it just as if it were a folder inside your subdomain directory. You need an admin privileges do create a symlink.

Dragan Okanovic
  • 7,509
  • 3
  • 32
  • 48
Erhart
  • 1