Definition: FTP allows you to transfer files between two computers on the Internet. FTP is a simple network protocol based on Internet Protocol and also a term used when referring to the process of copying files when using FTP technology.
To transfer files with FTP, you use a program often called the "client." The FTP client program initiates a connection to a remote computer running FTP "server" software. After the connection is established, the client can choose to send and/or receive copies of files, singly or in groups. To connect to an FTP server, a client requires a username and password as set by the administrator of the server. Many public FTP archives follow a special convention for that accepts a username of "anonymous."
Simple FTP clients are included with most network operating systems, but most of these clients (such as FTP.EXE on Windows) support a relatively unfriendly command-line interface. Many alternative freeware / shareware third-party FTP clients have been developed that support graphic user interfaces (GUIs) and additional convenience features. In any FTP interface, clients identify the FTP server either by its IP address (such as 192.168.0.1) or by its host name (such as ftp.about.com).
FTP supports two modes of data transfer: plain text (ASCII), and binary. You set the mode in the FTP client. A common error when using FTP is attempting to transfer a binary file (such as a program or music file) while in text mode, causing the transfered file to be unusable.
Also Known As: File Transfer Protocol
how to connect FTP server in java ?
import com.enterprisedt.net.ftp.*;
import java.net.*;
import java.io.*;
import java.net.InetAddress;
import java.text.*;
import java.util.*;
public class myFTPClient
{
String str[];
public static void main(String args[]) throws IOException, FTPException{
FTPClient f= new FTPClient("10.4.3.20");
f.login("ibolt","ibolt");
//FTPClient f = New FTPClient("10.1.1.4");
System.out.println("connection establish");
f.setConnectMode(FTPConnectMode.ACTIVE);
f.setType(FTPTransferType.ASCII);
//System.out.println("connection establish1");
f.get("C:/temp/pp.txt","map1.txt");
//System.out.println("connection establish3");
//System.out.println("connection released");
}
}
No comments:
Post a Comment