jQuery in Action, 3rd edition
The moose likes Sockets and Internet Protocols and the fly likes FTPClient problem(urgent) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "FTPClient problem(urgent)" Watch "FTPClient problem(urgent)" New topic

FTPClient problem(urgent)

rudolf hitler
Ranch Hand

Joined: Feb 07, 2003
Posts: 34
Im having problems performing ftp of a file to a another machine.Can someone tell me how to use FtpClient?

import java.io.*;
import java.net.*;
//import sun.net.*;
public class Example1
public static void main(String args[]) throws MalformedURLException
FtpClient ftp = new FtpClient();
OutputStream theFile = ftp.put("c:\\Madhu\\sports\\2003\\feb\\archive_display.html");

It says it cannot resolve symbol FtpClient do i have to download any jar file.If yes then where do i download it from and here do i place it and how do i make my program recognize it.

i tried using Ftp Client Library
from a site suggested on the ranch but to no avail.So if someone can send me the code for ftpclient and also tell me if any jar files are to be installed if yes where
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5382
First of all you have commented sun.net.* package.
Anyway here is lot of examples for ftp using apache package.
Here is one more ....dont use it
From here you can download org.apache.commons.net.* jar file.
I find apache package much easier to use than sun.net.* package whose API is also not available.
But if you want you can also find undocumented document

"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
I agree. Here's the link: http://aspose.com/file-tools
subject: FTPClient problem(urgent)
It's not a secret anymore!