• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 363
  • Last Modified:

Getting a list of directories/subdirectories on a client machine asp.net

How can I (on a web page in asp.net) get a listing of directories on the client machine?  I want the user to be able to search the local drives on the client machine and finally be able to choose a directory name (which I will then use to do some processing).

Ideally I would like the BROWSE capability when using the <input type=file> to upload files.

Thanks.
0
pmacmann
Asked:
pmacmann
  • 2
2 Solutions
 
Saqib KhanSenior DeveloperCommented:
> Ideally I would like the BROWSE capability when using the <input type=file> to upload files.

You answer your question already, thats the only option you have.


You CAN NOT browse Client Directory / Files programaticly, its a security violation, imagine i write  a programe search for all jpg files and copy them over to my Server.
0
 
davidlars99Commented:
adilkhan is absolutely right about the security issue, but you can do it something like that if you use ActiveX which is only/strictly for IE
0
 
pmacmannAuthor Commented:
OK - thanks... I'll have to think of  another solution.. I need the user to browse to a directory, then I take that directory name and parse out some information and then look in the directory for a specific file... I could probably have the user browse to the file in the directory and then get the directory name from there ...
0
 
davidlars99Commented:
as I said you can do it

var fso, dir, file;
fso=new ActiveXObject("Scripting.FileSystemObject")
dir=fso.GetFolder("c:\\")

there's whole lot more you can do with FSO

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsobjFileSystem.asp
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now