aspose file tools*
The moose likes Servlets and the fly likes saving xml file to a different server/dir in a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "saving xml file to a different server/dir in a servlet" Watch "saving xml file to a different server/dir in a servlet" New topic
Author

saving xml file to a different server/dir in a servlet

Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
I am using visual age java. I am getting an xml
file. I am saving the file. But it gets saved
to a directory under IBMVJAVA. BUt i want to
save that file to a differenet directory in
a oracle/unix server.
how can i do that.
I mean how can specify the path. and force it
to save that file to a particular directory in
that server.


Bhasker Reddy
Nitin Shivaram
Ranch Hand

Joined: Jan 17, 2001
Posts: 71
Can you be more specific?, how are you saving the xml file, are u using the File object or some proprietary code?


Nitin S<br />Sun Certified Java Programmer for the Java 2 platform.<br />Tekmetrics Certified Java Programmer For the Java 2 Platform.
Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
I am getting the file as an inputStream. I am writing it to the outputStreamWriter. This file
is getting saved in a directory in visual age java. I want to store it in oracle/unix server
in a particular directory.
does this help you
Nitin Shivaram
Ranch Hand

Joined: Jan 17, 2001
Posts: 71
Use a FileWriter object instead and give the directory name/file name as a String.
Be aware that you need to have write permissions from both the o/s and java. For o/s permissions contact your system admin, for java use "policytool"
The following is a code to get you started.
Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
I want to store it in a different server,
my code is located in ibm visual age 3.0.,
but i want to store the file in another server
how do i send file to that server
can i give the server address
rex.221.bs(rex name of the server)
221 is the port
bs is the user name
Nitin Shivaram
Ranch Hand

Joined: Jan 17, 2001
Posts: 71
at the top of my head, i can think of 2 ways to do it.
1) Have a multi-threaded program/server running on the other machine which listens for connections. The program/server reads from the socket and write to the disk. This server could be easily written in Java(piece of cake !! )
2) mount the other machine filesystem on to the current system. Then anything you write to that directory is as good as writing to the other machine.
Hope this helps.
Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
I am not sure how to write multithread server on
the other machine.
Can you advise me.
Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
can't i specify the path of the third database
server
"rex.21.bs/export/xml/" in the file path
but i checked it's not working.
I do connect to the other database server to
run some stored procedures, to update the tables
using java servlets present in ibm visual age java.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: saving xml file to a different server/dir in a servlet