Wayne Werner
Wayne Werner

Reputation: 51807

How do I get a pathname in ASP.NET?

I'm working on an internal web app and I need to get a directory path from the user. I (obviously) can use the asp:FileUpload to get a file but I can't find anything to just get a directory path.

Is there any (preferably simple) way to have a directory-chooser dialog in asp.net? I haven't been able to find any solution on Google or SO yet...

Thanks

Upvotes: 1

Views: 433

Answers (2)

Shankar R10N
Shankar R10N

Reputation: 4966

Did you try basic HTML <input type="file"> ??? Or does this not serve your purpose?

Upvotes: 0

Jeff S
Jeff S

Reputation: 7484

Because you are working on a web app, you are "stuck" with the limitations of what is allowed by the browsers. And I do not believe any of the browsers include a "directory-chooser".

You will probably just have to ask the user to paste the path into a textbox. You can then use some System.IO methods to verify the path is valid when the page is posted.

Upvotes: 1

Related Questions