Forum Moderators: open

Message Too Old, No Replies

Browsing Local Directories

Can users choose a directory on their machine using a browser?

         

AWillemsen

1:20 pm on Oct 21, 2003 (gmt 0)

10+ Year Member



I am involved in writing a browser-based UI to a spider/indexer that allows users to search files on their hard disk. One of the steps in the process of creating a new index is telling the spider which directory on the disk to start gathering data. I would like to have a "Browse" button on the HTML page which lets the user choose the directory (in the same way that "<input type=file>" allows them to choose a file for upload). Is this possible? I can use HTML, JavaScript or Java.

Thanks,

Andrew

korkus2000

3:19 pm on Oct 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use file://c:\ in an href. I don't know if it works in other browsers, but it will work in IE. You would have to work out what you wanted when they got there.

Java will have much more functionality. If you are using it I would look into an applet that did this.

DrDoc

3:32 pm on Oct 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The <input type="file"> thing won't work, since it can only grab files. However, even still, scripting of it is in most cases not allowed, because of security issues.

hartlandcat

3:42 pm on Oct 21, 2003 (gmt 0)

10+ Year Member



It definately works in IE, Netscape, Mozilla, Opera and Konqueror, and probably many others as well. Please bear in mind tat the way the folders etc. are displayed will differ from browser to browser, and that IE and Konqueror allow much more control over the folders etc. than others (for obvious reasons).