aspose file tools*
The moose likes JSP and the fly likes Folder Browser Dialog on a button click Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Folder Browser Dialog on a button click" Watch "Folder Browser Dialog on a button click" New topic
Author

Folder Browser Dialog on a button click

Bharath Kumar Alapati
Greenhorn

Joined: Aug 14, 2008
Posts: 11

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.



Thanks,
~Alapati
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bharath Kumar Alapati
Greenhorn

Joined: Aug 14, 2008
Posts: 11

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

Joined: Jan 10, 2002
Posts: 61206
    
  66

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Folder Browser Dialog on a button click