This article describes how FTP works and how it works.
There are two ways to transfer ftp: ASCII transfer mode and binary data transfer mode.
1. ASCII transfer mode: Assuming that the file that the user is copying contains simple ASCII text, if it is not UNIX running on the remote machine, FTP usually automatically adjusts the contents of the file when the file is transferred so that the file can be interpreted as another computer's format for storing text files.
However, it is often the case that the files that the user is transferring contain not text files, which may be programs, databases, word processing files, or compressed files (although the word processing file contains mostly text, which also contains nonprinting characters that indicate page size, font, etc.). Before copying any text file, use the binary command to tell the FTP verbatim copy, do not deal with these files, this is also the following to speak of the binary transmission. Recommended reading: FTP use command detailed
2. Binary transmission mode: In binary transmission, save the bit order of the file so that the original and the copy are bitwise by. Even if the destination machine contains a bit sequence of files is meaningless. For example, the Macintosh transmits the executable file to the Windows system in binary mode, and the file cannot be executed on the other side of the system.
If you transfer binary files in ASCII mode, they will still be translated even if they are not needed. This slows the transfer slightly, and it can damage the data, making the file unavailable. (on most computers, the ASCII method generally assumes that the first significant bit of each character is meaningless because the ASCII character combination does not use it.) If you transfer binary files, all bits are important. If you know that the two machines are the same, the binary is valid for both the text file and the data file.
How the FTP works
FTP supports two modes, one is called standard (that is, port mode, active mode), one is passive (that is, PASV, passive way). Standard mode FTP client sends the port command to the FTP server. Passive mode FTP client sends PASV command to FTP server.
Here's how one of these two ways works:
The Port mode FTP client first establishes a connection to the FTP server's TCP 21 port, which sends a command to send the port command on this channel when the client needs to receive data. The port command contains what ports the client uses to receive data. When transmitting data, the server side sends data through its own TCP 20 port to the client's specified port. FTP server must establish a new connection with the client to transfer data.
The passive mode is similar to the standard mode when it establishes the control channel, but when the connection is established, it is not the port command but the PASV command. The FTP server receives the PASV command, randomly opens a high-end port (the port number is greater than 1024) and notifies the client of the request to transmit data on this port, the client connects to the FTP server, and then the FTP server transmits the data through this port, and this time the FTP Server no longer needs to establish a new and client connection.
Many firewalls are not allowed to accept externally initiated connections when they are set up, so many FTP servers behind the firewall or intranet do not support PASV mode because the client cannot open the high-end port of the FTP server through the firewall, and many intranet clients cannot log on to the FTP server with Port mode. Because TCP 20 from the server cannot establish a new connection with the internal network's clients, it does not work.
If you do not know how to use FTP under the things, it is very good to solve, as long as the next FTP software, such as flashfxp,ultraftp and so on software, inside the input address directly download it.
If you want to build an FTP site, you have to do your own software configuration with server-u or other software directly set up on it.