I want to use the equivalence of open file dialog box in windows forms (FolderBrowserDialog) in asp. I see the FileUpload class but the user is still forced to select a file. I only want the directory portion. The resulting string that contains the directory path will be added to a table in which a different process will use at a later time.
Asked
Active
Viewed 118 times
-2

Uwe Keim
- 39,551
- 56
- 175
- 291

Liz Ravenwood
- 73
- 1
- 8
-
2This is not possible. Information regarding a user's filesystem is never exposed to web-applications, even the file-path given to an `` is truncated to only show the filename, not its path. (older versions of Internet Explorer and Firefox did expose the full path, but this behavior was changed over 6 years ago). – Dai Feb 23 '17 at 22:18
-
Sounds like an [XY problem](http://xyproblem.info/). – Uwe Keim Feb 23 '17 at 22:22
-
The intention is to be a web app that is linked from without our company intranet. I'll have to write a windows form app then. – Liz Ravenwood Feb 23 '17 at 22:23
-
It's not that complicated what I want so I don't understand what elaboration is required. I want string strPath = DirectoryPathResultWithoutFile().ToString(); ;-) – Liz Ravenwood Feb 23 '17 at 22:31
-
Because the architecture of this "web" thing is not intended/suitable for accessing local directory structures. Thus, your question can only be answered with "You can't". – Uwe Keim Feb 23 '17 at 22:33
1 Answers
0
It is better to say your scenario clearly and point out what you want asp to do with a directory on client side.
If you want user to browse server side directories,you will need javascript to achive that.
FolderBrowsingDialig in winforms is aimed to select a directory so that the program can do sth with it.But in web app, a web page doesnt need to do anything with client directories(nothing comes to my mind unfortunately)
Please clarify your scenario to get quicker help. There might be other ways to achieve it.

Efe
- 800
- 10
- 32