This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Folder Browser Dialog on a button click

 
Bharath Kumar Alapati
Greenhorn
Posts: 11
Chrome Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm working on this project where we display folders under certain base-folder.

I want to implement the move a file functionality where user selects a file in a folder and clicks the move button shold display a "folder browser dialog".
Once selected a folder, move to the file to that folder. (Note this is all Folders from Server not from the client desktop)

Any ideas are welcome. (Searched for Jquery and what not...)

Also, i'd like to know if we can open a Folder Browser dialog using java script and System.Windows.Form.

Please advise.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course not. Pages in a browser have no direct access to the file system on either the server or the client. Imagine the security implications if they did.

If you want to expose the server file system to the client, you'll need to use Java file I/O to obtain the information and create a page that represents it.

Or, if you are completely focused on Windows and IE (as your post seems to insinuate) there may be ActiveX or other proprietary means to accomplish this. But that has nothing at all to do with JSP.
 
Bharath Kumar Alapati
Greenhorn
Posts: 11
Chrome Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I do agree with you, that displaying the server file system is a bad idea from a security perspective.
But my requirement asks for it, and i can't help them understand the implications.

Anyways,
I've a page that displays the server folders (lets say only from /var/temp/ as root folder ), and a little bit functionality that i've added like create a folder, upload a file to the current folder using apache commons library, delete a file and delete a folder.

But not sure how to implement move functionality.

This is not a Windows application, and my dev env is Java, JSP, servlets, tomcat.

I've a jquery plugin (jquery file tree plugin) that can display server folders but not sure what container i should use to display it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most of the jQuery tree plugins I've seen support some sort of drag and drop. Or you can use jQuery UI to add it yourself. Use the drop event to send an Ajax request to the server with the info necessary to move the file.

You might want to also explore the results of search for jQuery file browser to see if anyone has already solved the problems for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic