aspose file tools*
The moose likes Servlets and the fly likes File upload to a Remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "File upload to a Remote server" Watch "File upload to a Remote server" New topic
Author

File upload to a Remote server

Sudhakar Krishnamurthy
Ranch Hand

Joined: Jun 02, 2003
Posts: 76
Hello:
Here's my problem:
I have a server A that has a file "A.txt" i need to send this file to a remote server B(on a different subnet but visible to server A) and store the result of this operation on server A.
How can i do this using servlets?
Any help is greatly appreciated.
cheers
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
To tell if you can do this we need to know what (if any) services the destination machine offers. Does if have an FTP server running? NFS? SMB? Can you run a servlet on the destination machine to receive an upload?
How you transfer a file depends entirely on what software is running on the destination machine.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Sudhakar Krishnamurthy
Ranch Hand

Joined: Jun 02, 2003
Posts: 76
I have a web server that is running on the desitnation system and i have access to the remote system only through the web server so i cannot use services like ftp, rlogin. I do have a servlet that is running on the remote system.
Thanks
Sudhakar Krishnamurthy
Ranch Hand

Joined: Jun 02, 2003
Posts: 76
How can i do this without using RMI??
Any help is greatly appreciated.
-Sudhakar
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
If all you want to do is to write some code which sends things to a servlet on a remote machine, you might as well use of the free APIs for that sort of thing. I usaully use httpunit - see this other recent thread for more details.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File upload to a Remote server