Click here to Skip to main content
14,827,034 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have web application in that i want local disk path where i want to save or download files to local disk from my web application.Here i have used treenode to create perticular directory structure.Here problem is when i host my web application on server then it shows only server directory structure instead of local machine
If any idea then share with me .

thanks in advance

What I have tried:

TreeNode onjParent = new TreeNode("D:\\", "D:\\");
                onjParent.PopulateOnDemand = true;

private TreeNode AddNodes(string path, TreeNode parentNode)
            FileList objList = new FileList(path, "*.*");
            TreeNode node = new TreeNode(path, path);
            for (int index = 0; index < objList.Directories.Length; index++)
                string directory = objList.Directories[index];
                TreeNode objChildNode = new TreeNode(directory, path + "\\" + directory + "\\");
                objChildNode.PopulateOnDemand = true;
                objChildNode.Target = "_blank";


It shows mi directory structure but it shows server directory after hosting
Updated 24-Feb-17 19:38pm

1 solution

The Application which you have hosted in the IIS will have the permission to access only the project folder. It cannot access any other directory, this is how IIS works.

it shows server directory after hosting

Since it is hosted in server, that will show only the server path.
SujataJK 25-Feb-17 6:35am
thanks sir for reply

but In my web application user has browse and download Button when it click on browse button then it requires folder selection for download all files in same folder.
Karthik_Mahalingam 25-Feb-17 6:38am
he wil be able to browse only the client machine folder, not the server folder..
SujataJK 25-Feb-17 6:58am
exactly.. but how to do that?
Karthik_Mahalingam 25-Feb-17 7:00am
just click and browse using file upload control.
SujataJK 25-Feb-17 7:12am
but file upload does not provide folder selection functionality.We can just select file i want folder selection.
Karthik_Mahalingam 25-Feb-17 7:13am
due to security reasons, it is not possible.
SujataJK 25-Feb-17 7:24am
ok.I in my task i have to provide folder selection for user where user can download all files
Karthik_Mahalingam 25-Feb-17 7:26am
Its not possible. he shall download only the files from the project folder.
SujataJK 25-Feb-17 7:25am
is there any other way
Karthik_Mahalingam 25-Feb-17 7:27am
as far as i know, its not possible to download files outside the project folder.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900