| Author |
FTP using java
|
Aditya Sirohi
Ranch Hand
Joined: Jan 05, 2010
Posts: 91
|
|
Hello Folks,
I need to transfer file from one computer to another in the LAN. I saw some documents on FTP, can you let me how can i approach this problem? Do i need to write both client and server for this? I think if i start with a simple code that replicates file transfer using command line ( filetransfer.java C:\\test.txt [IP of the destination machine]), that would be a good start for me.
Thanks
Adi
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
Who says you have to do it in Java? And why?
It's extremely unlikely that you would have to write the server in Java. If somebody says they're going to use FTP then it's extremely likely that they have an FTP server running already. Or if they don't have one, then there's one which came with their computer which they can just start up. So before you start rushing off to do something, find out what exactly you have to do and what you don't have to do.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32654
|
|
|
Too difficult a question for "beginning". Moving. Maybe Java™ in General, maybe General computing . . . not sure, but let's try general computing.
|
 |
Victor Ramen
Ranch Hand
Joined: Jul 14, 2008
Posts: 56
|
|
Aditya Sirohi wrote:Hello Folks,
I need to transfer file from one computer to another in the LAN. I saw some documents on FTP, can you let me how can i approach this problem? Do i need to write both client and server for this? I think if i start with a simple code that replicates file transfer using command line ( filetransfer.java C:\\test.txt [IP of the destination machine]), that would be a good start for me.
Thanks
Adi
Depends. Assuming server = source and client = destination, does the client trigger the FTP? i.e. Is it a pull mechanism? Or a push where server FTP-s without any request from the client.
In the former case, you need to write both client and server. In the latter case, only server.
|
 |
Martijn Verburg
author
Bartender
Joined: Jun 24, 2003
Posts: 3268
|
|
|
I would be inclined to use a 3rd part tool/lib. so Apache Commons Net if you're going to do it programatically.
|
Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
|
 |
 |
|
|
subject: FTP using java
|
|
|