Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Java in General and the fly likes FTP  using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "FTP  using java" Watch "FTP  using java" New topic

FTP using java


Joined: Feb 07, 2005
Posts: 3
Hi All,

Does java supports using FTP?

Actually I am trying to get data from different Windows NT machines to UNIX box using java, Please provide me with some idea on this.

Thanks in advance,

Julia Reynolds
Ranch Hand

Joined: May 31, 2001
Posts: 123

We use the apache commons net package.

The code is simple to implement, here is a sample:

// Connect and logon to FTP Server
FTPClient ftp = new FTPClient();
ftp.login(username, password);

// Change to the directory

FileInputStream src2 = new FileInputStream(outFile);
ftp.storeFile(filename,src2 );

Hope this helps,

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
This is my favorite site. Plus the site has a lot of examples:
I agree. Here's the link:
subject: FTP using java
Similar Threads
ftp with java
Image Upload Using Java
How to access remote folder files without using ftp or tftp using java
Uploading an entire folder using Java