wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "FTPClient problem(urgent)" Watch "FTPClient problem(urgent)" New topic
Author

FTPClient problem(urgent)

rudolf hitler
Ranch Hand

Joined: Feb 07, 2003
Posts: 34
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

Joined: Oct 15, 2001
Posts: 5371
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


"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)
 
Similar Threads
how to connect FTP server in java
I/O stream handling by FTPClient
TelnetProtocolException
FTP Client
FTP between SUN and Linux servers