Asked by:
Window explorer or File Explorer control in asp.net web page

Question
-
User-1068576637 posted
Very Good Morning,
I have got File server URL. Based on the URL Path.
I want to list folder and files and also access those files in vb.net web page . Is there any control which acts as window explorer in asp.net web page.
My goal is to read and write files should be controlled using asp.net page rather going to window explorer .
Asp.net web page interface should be like a tree view where they can select the folder and view the files .
This is purely asp web site.
I need your support.
Wednesday, February 20, 2019 4:04 AM
All replies
-
User409696431 posted
You can write code to use the TreeView control to accomplish this. See this link for the details, and the code: https://www.aspsnippets.com/Articles/Display-Directory-Folder-structure-using-ASPNet-TreeView-control-in-C-and-VBNet.aspx Do note the comment that "In order to open (download) files using the TreeView Node, the root folder and all the files must be present inside the Website’s Root folder."
Wednesday, February 20, 2019 6:31 AM -
User-1068576637 posted
Dear Kathy ,
Thanks for your help . My files are stored in different location in file server. Is there any way to open the files ? Is there any third party control similar to windows explorer for using in asp.net web.
Wednesday, February 20, 2019 9:08 AM -
User-893317190 posted
Hi Mohammed Tajudeen,
Is your server that serves vb application different from the server that servers files?
If they are not the same server, it relates to remote calls not just a control problem
Your vb application should send request to your file server and you file server should return data about the file structure of the fileserver.
If you are sure you file server could provide such service, you could consider using httpclient.
https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=netframework-4.7.2
If your server that serves your vb application is the same as your file server, even they are stored in different , you could use two tree views or use a root folder that contains all your files in different locations to just use one tree view.
About open file, there is not consistent solution, because all kinds of files have different mime type.
If the file is pdf, you should use the File api to read the content of the pdf and change the contentType to application/pdf then return the content.
If the file is excel, you should use excel api to read the content of the excel and show the data in a control for example gridview.
Best regards,
Ackerly Xu
Thursday, February 21, 2019 2:45 AM -
User-1068576637 posted
Hi Ackerly,
Yes , Files is stored in the different server and my application is in different server.
Thursday, February 21, 2019 5:09 AM -
User-893317190 posted
Hi Mohammed Tajudeen,
Then you should check whether your file server has the interface to provide data of its file system.
Because one computer has no access to another computer's file system.
It is not enough to get the url of file server.
Best regards,
Ackerly Xu
Thursday, February 21, 2019 5:23 AM -
User-1068576637 posted
Ok I will check with the interface in file server. To read and write in file server using asp.net web application interface , which is best method to do.?
Friday, March 1, 2019 5:42 AM -
User-893317190 posted
Hi Mohammed Tajudeen,
Not clear about your file server, as far as I know , few file server has this feature.
If it has , it should have corresponding interface for you, for example , you may use a class which could communicate with the file server.
Best regards,
Ackerly Xu
Friday, March 1, 2019 6:43 AM