Moving a file on a server is not too difficult although there is no quick
and dirty answer. Your servlet must do all the work itself. Here is what
I'd do:
use the native java io classes to get a list of files in the "source"
directory.
create a clas which is responsible for actually moving the file. (FileMover)
the servlet will take the list of files provided by the java io class and
create an html page with the filenames listed.
When the user clicks on the file the href will execute another servlet
which takes the filename provided to it and sends it to the FileMover.move(
String filename);
The FileMover.move() will do the actual moving of a file (os dependent stuff)
As for the other question, I'm not sure how you'd do it. It would seem
that you would have to know the name of the edited file (worse case, the
goofy filename in the browser cache directory) and then do a file upload.
How ever you do it, I don't think its a trival problem. I may be wrong though.
clint
At 07:58 PM 6/14/00 +0000, you wrote:
>Hi Gentlemen,
>
>- How can I simply Move a file on the server, to a different directory
>throught a servlet ?
>
>(the client chooses a file by clicking on a button and the file is moved
>from a directory_1 to a directory_2.)
>
>
>- How can I Save a file on the server, after it has been modify by the
>client with his browser ?
>
>(the client open a file with <a href="file.doc" target="new_window">, then
>modify it with WinWord, then he saves the file not on his disk but on the
>server disk, then he closes winword.)
>
>I checked servlet-archives and Java-doc-api, and didn't find any quick and
>easy solution.
>
>Thanks,
>
>/Matt.
>________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html