Help Center/ Elastic Cloud Server/ FAQs/ File Upload/Data Transfer FAQ/ What Should I Do If Writing Data Failed When I Upload a File Using FTP?
Updated on 2024-09-26 GMT+08:00

What Should I Do If Writing Data Failed When I Upload a File Using FTP?

Symptom

When I attempted to upload a file using FTP, writing data failed. As a result, the file transfer failed.

Constraints

The operations described in this section apply to FTP on Windows ECSs only.

Possible Causes

When NAT is enabled on the FTP server, the FTP client must connect to the FTP server in passive mode. In such a case, the public IP address (EIP) of the server cannot be accessed from the router. You need to add the EIP to the public IP address list on the server. Additionally, set the port range to limit the number of ports with data forwarded by the router.

Solution

The EIP must be associated with the private IP address using NAT, so the server must be configured accordingly.

  1. Set the public IP address of the server.

    Choose Edit > Settings.

    Figure 1 Setting the public IP address
  2. Choose Passive mode settings, set the port range (for example, 50000-50100) for transmitting data, and enter the target EIP.
    Figure 2 Setting the range of ports for data transmission
  3. Click OK.
  4. Allow traffic on TCP ports 50000-50100 and 21 in the security group in the inbound direction.
  5. Test the connection on the client.