File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
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: 61417
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    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: 61417
    
  67

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Browse folder/directory only and not files