View Full Version : Listing all folders in the server

03-15-2006, 10:30 PM

The user has to upload a file on to the websever. I want to display all the folders that exist in the server, so that he can select a specific folder to save the file. I am using Asp.net & C#. I need the code either in javascript/asp/asp.net code or some lang. which can be called using asp.net.

Thank you

03-16-2006, 03:52 AM
do a google search on asp's file system object. This will do exactly what you want

03-16-2006, 06:58 PM
Actually i need that in either javascript/Asp.Net

03-18-2006, 03:18 PM
Without seeming like a B**** if you wanted a .Net answer did you post in the .Net forum?

Client side Javascript is just that CLIENT SIDE in other words you cannot read whats on the server with client side script. You can read what's on the client with it but that is all.

However, to do this in asp.net you need to use 2 classes, one for directories and one for files. To access directory information, use either the Directory class or the DirectoryInfo class; to access file information, use either the File class or the FileInfo class.

you can find an example here http://www.upyourasp.net/articles/article.aspx?aid=5