.Net MVC. I want to load a XML file from my directory and the directory path can be random. I can load the XML file but I need also to know my file directory path. Can anybody give me the idea how can I get the full directory path of my XML file. Suppose the file is in C:\abc\test.xml or D:\cde\test2.xml. If I load 1st one I need the directory path as C:\abc\test.xml in my application.
-
1If you loaded the file, don't you already have the full path??Adam Schiavone– Adam Schiavone2016-09-22 13:14:22 +00:00Commented Sep 22, 2016 at 13:14
-
1You want to know the full directory of the file on the client's machine? That's not really possible within the browser's sandbox. You would need additional program to run on the client's machine.mason– mason2016-09-22 13:14:25 +00:00Commented Sep 22, 2016 at 13:14
-
1You can use Server.MapPath("~/abc//test.xml") to get directory pathShakir Ahamed– Shakir Ahamed2016-09-22 13:16:00 +00:00Commented Sep 22, 2016 at 13:16
-
@ShakirAhamed Thanks for your comment. But this one is howing "c:\\users\\hasan\\documents\\visual studio 2015\\Projects\\PPGWeb\\PPGWeb\\" directory where I don't have any test.xml file.Mahbub– Mahbub2016-09-22 13:37:20 +00:00Commented Sep 22, 2016 at 13:37
-
Which version of ASP.NET / MVC?Simon Ordo– Simon Ordo2016-09-22 15:35:25 +00:00Commented Sep 22, 2016 at 15:35
|
Show 1 more comment