• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JFileChooser in a webapplication

 
sadanand munswamy
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I need to use JFileChooser in my web-application, any help will be deeply
appropriated.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49808
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn’t say what you know about file choosers already, so I shall give you a Java tutorials link.
 
sadanand munswamy
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Campbell Ritchie,
I have been doing java for a long time, So i do know it.
Some how i need to invoke a file chooser from my web-application that should allow
the user to choose only directory and no files.
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can only use a JFileChooser in combination with an applet. Because of the applet's security restrictions, it needs to be signed first.

The important question is, however, why you need to let users select a directory. Using a JFileChooser would let the user choose a local directory where the server has no access to (other than through the applet, but only while the applet is active). Is that what you want? Or do you want the user to select a directory on the server? In that case, perhaps you can build some HTML based file browser yourself (or find some existing code to do that). Make sure that the user cannot select just any directory; keep the selection as limited as possible.
 
sadanand munswamy
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Rob,
Thanks for your valuable insights, And you are absolutely correct, as i need to choose any directory
from the server and not the local. Is there any read to use html file chooser, which can do the trick for me.
Thanks Again.
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out http://stackoverflow.com/questions/9068156/server-side-file-browsing. You may need to tweak it a bit to get it to show only directories.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic