1

There is a page on my site that asks the user enter in a path to a folder/file. This folder/file exists on the local machine. Instead of having the user type out this directory, I would like to have the user choose the path via some sort of pop-up where the user can browse folders/files on their local machine. Once a folder/file is chosen in the dialog, I would like the path of this folder/file to be displayed in a text box ready to be submitted to the server.

I have searched all over Google and this site in search of a solution that fits my particular needs. Please remember, I need this to work for both folders and files.

For example, instead of having the user type in "C:\Users\Me\Desktop\MyFile.txt", I would like them to be able to browse for this in a dialog. They should also be able to select a folder like "C:\Users\jselesky\Desktop\". I am using ASP.NET MVC3 with C# for my web site. Thank you.

tereško
  • 58,060
  • 25
  • 98
  • 150
Jack Selesky
  • 11
  • 1
  • 2
  • Can you not just use a standard file select? http://en.wikipedia.org/wiki/File_select – Mansfield Jun 21 '13 at 18:14
  • Have a look at my answer http://stackoverflow.com/questions/18440220/how-to-upload-file-in-strong-type-view-in-asp-net-mvc/18441187#18441187 – Jatin patil Sep 06 '13 at 09:42

1 Answers1

0

If you want path and name of existing file then you can simply use <input type="file"> in HTML.

And if you want file path and name for saving a file.. then Me too searching for the same answer...

blue
  • 568
  • 3
  • 10
  • 30