我试过的所有 FTP 客户端都出现了同样的问题。而且我的电脑或路由器上没有设置防火墙。
连接到 FTP 服务器并上传文件时,传输达到 100% 后连接会停止,然后与服务器的连接会关闭。
文件确实已完整上传,因此看起来客户端在完成时并没有结束传输。
(以下域名和 IP 已被编辑)
我遇到此问题的 FTP 服务器都是 One.com 服务器。
我已经与他们的支持人员进行了交谈,我们确定问题出在我这边。
我尝试ftp
在 Windows 中使用以下命令:
C:\WINDOWS\system32>ftp ftp.example.com
Connected to ftp.example.com.
220 Welcome to One.com FTP.
500 'OPTS': command unrecognized.
User (ftp.example.com:(none)): example.com
331 User example.com OK. Password required
Password:
230-User example.com has group access to: 2810660
230 OK. Current restricted directory is /
ftp> cd test
250 OK. Current directory is /test
ftp> lcd F:\xampp\htdocs\example
Local directory now F:\xampp\htdocs\example.
ftp> put index.php
200 PORT command successful.
150 Connecting to port 56694
Connection closed by remote host.
ftp>
还有Filezilla:
Status: Resolving address of ftp.example.com
Status: Connecting to 0.0.0.0:21...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Status: Connected
Status: Retrieving directory listing...
Status: Directory listing of "/" successful
Status: Disconnected from server
Status: Resolving address of ftp.example.com
Status: Connecting to 0.0.0.0:21...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Status: Connected
Status: Starting upload of F:\xampp\htdocs\example\index.php
Command: CWD /
Response: 250 OK. Current directory is /
Command: PWD
Response: 257 "/" is your current location
Command: TYPE A
Response: 200 TYPE is now ASCII
Command: PASV
Response: 227 Entering Passive Mode (0,0,0,0,247,194).
Command: STOR index.php
Response: 150 Accepted data connection
Error: Connection timed out after 20 seconds of inactivity
Error: File transfer failed
Status: Disconnected from server
本次测试中的文件传输仅花费了半秒钟。这是一个 2040 字节的文件……
所以超时不是由于这个原因造成的。
FTP 服务器上的所有其他操作似乎运行正常。
现在我必须一次上传一个文件,并阻止 FileZilla 尝试重新上传文件(因为连接断开)。然后再上传下一个文件,依此类推……