• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

FTP using java

 
Ranch Hand
Posts: 93
Eclipse IDE VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 26946
83
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 74620
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too difficult a question for "beginning". Moving. Maybe Java™ in General, maybe General computing . . . not sure, but let's try general computing.
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would be inclined to use a 3rd part tool/lib. so Apache Commons Net if you're going to do it programatically.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic