Skip to content Skip to sidebar Skip to footer

How To Get Physical Path Of Working Folder In Javascript Or Jquery?

How to get Physical path of working folder in jscript or jquery? What i need is when a dropdown is selected or if a button is clicked i need to get complete path of the working fol

Solution 1:

I think you are looking for something like this:

var x = ('<%=HttpUtility.JavaScriptStringEncode(Server.MapPath(Request.Url.LocalPath))%>');

Now, how useful is that information on the client side is something that's not clear to me, besides being risky, in my opinion...

On my PC, it prints this if I do console.log(x):

\\company\home_drives$\rsanchez\visual studio 2012\Projects\test\test\Default.aspx 

Solution 2:

Solution 3:

You would need to collect all of the physical paths on the server, and pass them to the client. If you wanted the entire folder structure, you'd have to pass it down to the client and construct the folder structure.

I assume you are referring to something like a file manager that a hosting company might use.

Post a Comment for "How To Get Physical Path Of Working Folder In Javascript Or Jquery?"