Results 1 to 4 of 4
- 02-08-2010, 03:34 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 2
- Rep Power
- 0
How to create file into another host from a host
Hi,
I want to create a file "file1.txt" which holds the input from host1.
I have to upload this file in another host (host2).
I could connect to host2 location using http. The location is
http://host2/file/
Kindly let me know if there exists a solution.
Thank You.
- 02-10-2010, 12:53 AM #2
Yes, there exists a solution to do this.Kindly let me know if there exists a solution.
- 02-10-2010, 08:36 AM #3
Member
- Join Date
- Feb 2010
- Posts
- 2
- Rep Power
- 0
File creation in one host from another host
Can you please explain the approach to achieve this
- 02-10-2010, 09:03 PM #4
well, the problem is not clearly stated, so ill try based on some assumptions.
I assume that server1 is a web server and it has received data from a user that filled in a form on a screen in an application in server1 and for what ever reason we want to get this data to server 2.
You said upload, so I assume you don't have direct database or file system access, such as it is to an external site and the only aproach is HTTP.
So in this case, I would probably use a http client library such as the commons-httpclient from a servlet inside my server1 application to do a HTTP post to the server2.
where server2 would run a servlet mapped to a url that i expect to be secured and only invocabley by server1, perhaps http authentication. and i would have the servlet receive the post body, which in this case is the file content, and write it out to the server 2 file system, or what ever it is that it should do with it.
though this sounds a lot like what would be readily possible to do with web services, such as a SOAP message, which would probably use axis2 library, or JSON message which I would use my own json.org based parser in my receiver servlet. and possibly not even use a file, but the form data contents as the message body.
but either of the HTTP based messaging approaches is well suited for use where the sender is a web server (server1), or a human running a command line application with the commons-httpclient or axis2 libraries built into it, to connect to the server2
hope that helps
Similar Threads
-
copy file from local host to remote host
By isotoper in forum New To JavaReplies: 4Last Post: 12-24-2009, 04:41 PM -
Host Blacklisted
By neeti in forum NetworkingReplies: 6Last Post: 10-27-2009, 10:31 AM -
Unable to connect to MySQL on another (unix) host from Eclipse on my windows host
By kairamr in forum EclipseReplies: 0Last Post: 10-31-2008, 07:07 PM -
Looking Up the Address of a Host
By Java Tip in forum java.netReplies: 0Last Post: 04-07-2008, 08:11 PM -
Getting the host of the applet
By Java Tip in forum Java TipReplies: 0Last Post: 03-10-2008, 02:56 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks