tags:

views:

102

answers:

2

Our web client needs a way to browse the local network and select location for file storage. This will then be returned to the webpage as a UNC name.

On a native client this easily accomplished by using Shell32 functions.

I've looked at ASP FileUpload, but that returns the file vs. a specific directory.

EDIT: Another option would be to execute this on the clientside using javascript.

A: 

You actually can use the Shell32 functions in C#, see P/Invoke.

arul
+1  A: 

If by "web client", you mean a web browser - then you really can't. There's an HTML file input, but it requires a file (which is no doubt what ASP FileUpload was using). There's Shell.Application.BrowseForFolder and you could create your own using Scripting.FileSystemObject - but those are Windows only, and would probably be locked down with security restrictions these days.

If you're willing to take a dependency on Flash or Silverlight, you could probably build or buy something in them. However, I don't think Silverlight has a built in control for it (OpenFileDialog is the closest, but looks to also only allow selecting a folder).

Mark Brackett