Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FTPClient problem(urgent)

 
rudolf hitler
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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();
ftp.openServer("shuttle");
ftp.login("Administrator","mdroy");
ftp.cd("c:\\DDDD");
ftp.ascii();
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
Thanx
 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
HTH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic