문제

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 :)

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top