This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Browse folder/directory only and not files Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Browse folder/directory only and not files" Watch "Browse folder/directory only and not files" New topic
Author

Browse folder/directory only and not files

rahulJ james
Ranch Hand

Joined: Oct 03, 2008
Posts: 123
Is it possible to browse a directory rather than files in java script. I saw similar quesitons in this forum but I do not see a complete solution to this.
Can someone advise.

Or if there is an alternate way to accomplish this functionality
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56521
    
  14

You can't browse anything in JavaScript. If you are really asking about the file input control, then sure, you can browse folders to your heart's content. but you can only select a file.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15361
    
    6
PLUS modern day browsers do not send up the paths to the files/folders to the server so it is useless.

Eric
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

You can't with Javascript, but you could write your own applet and make your own "directory" browser.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56521
    
  14

Assuming that the applet is signed and that the user gives permission.
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Bear Bibeault wrote:Assuming that the applet is signed and that the user gives permission.

Of course; that's implied
 
jQuery in Action, 2nd edition
 
subject: Browse folder/directory only and not files
 
Similar Threads
Multiple File Upload from a directory
Creating a browse button
Hi
Browse Button in HTML For Directory Selection
Browse File functionality in JSP