File Transfer Protocol (FTP) is a standard protocol used for transferring files over a network. It belongs to the application layer of network transmission protocols.
FTP is an 8-bit client-server protocol that can operate on any type of file without requiring further processing, similar to MIME or Unicode. However, FTP has extremely high latency, which means the time from the initial request to the first receipt of the requested data can be very long, and there are often lengthy login procedures that must be executed.
FTP services generally operate on ports 20 and 21. Port 21 is used for data flow transmission between the client and server, while port 20 is used for control flow transmission and is the command input to the FTP server. When data is transmitted via the data flow, the control flow is idle. When the control flow is idle for a long time, the client's firewall may timeout its session, which can lead to issues when a large amount of data is being transmitted through the firewall. In this case, while the file may be successfully transmitted, the control session may be terminated by the firewall, resulting in transmission errors.
Although FTP can be used directly by end users, it is designed to be controlled by FTP client programs.
Many sites that run FTP services offer anonymous services, allowing users to log in to the server without an account. By default, the username for anonymous users is "anonymous." This account does not require a password, although it typically asks for the user's email address as an authentication password, but this is just a detail, and the email address may not be validated at all, relying instead on the configuration of the FTP server.
FTP has two operational modes: active and passive. Active mode requires both the client and server to open and listen on a port to establish a connection. In this scenario, the client may encounter some issues due to the firewall. Therefore, passive mode was created. Passive mode only requires the server to create a process that listens on the corresponding port, which circumvents issues caused by firewalls on the client side.
The steps to establish an FTP connection in active mode are as follows:
Most modern web browsers and file managers can connect to FTP servers. This allows remote files to be manipulated through an interface just like local files. This functionality is implemented by providing an FTP URL in the form of ftp://
蘊藏許多助人的知識與智慧。