FTP client instructions

更新时间:
复制 MD 格式

This topic describes the File Transfer Protocol (FTP), its working modes, and what to consider when you use an FTP client to connect to a Cloud Web Hosting instance.

Introduction to FTP

  • The File Transfer Protocol (FTP) is a protocol in the TCP/IP protocol suite. When you develop a website, you can use an FTP client to upload files, such as programs and web pages, to a web server.

  • FTP has two working modes: active (PORT) and passive (PASV). The workflow is as follows:

    Workflow

    Active mode (PORT)

    Passive mode (PASV)

    ① Send connection request

    The FTP client sends a connection request to the server's FTP port, which is 21 by default.

    ② Establish command link

    The server accepts the connection request and establishes a command link.

    ③ Send command

    To transfer data, the client sends a PORT command over the command link to the server. The command includes the port on which the client will accept data.

    To transfer data, the client sends a PASV command over the command link to the server. The server receives the command, opens a random port, and sends the port information to the client.

    ④ Transfer data

    After the server receives the command, it sends a connection request from its own port 20 to the port specified in the PORT command. This establishes a data link to transfer data.

    The client sends a connection request to the server's port. This establishes a data link to transfer data.

FTP considerations

Note the following points about your FTP client, which depend on whether it has a public IP address and is behind a firewall.

  • If your FTP client does not have a public IP address, use passive (PASV) mode to connect to the Cloud Web Hosting instance.

  • If your FTP client has a public IP address and is behind a firewall, open ports above 1024 on the firewall to use active (PORT) mode. This prevents the firewall from blocking connection requests sent from the Cloud Web Hosting instance to establish the data link.