IdFTP->Get(),之后,在Onwork事件中处理下载进度条,顺便加一个ProcessMessage()防止程序不响应。现在的问题是下载到一半时如何取消下载?我使用IdFTP->Abort(),会报错“450 error during writing data to connection”。之后ftp连接保持着,但是不能执行任何命令。怎么解决?
...全文
24014打赏收藏
关于Idftp下载文件时如何取消下载
IdFTP->Get(),之后,在Onwork事件中处理下载进度条,顺便加一个ProcessMessage()防止程序不响应。现在的问题是下载到一半时如何取消下载?我使用IdFTP->Abort(),会报错“450 error during writing data to connection”。之后ftp连接保持着,但是不能执行任何命令。怎么解决?
如何能在abor以后重新接受客户端的ftp命令请求?
大致是以下的一个出错过程。Abor以后就出错了
STATUS:> Connecting data socket...
150 Accepted data connection
COMMAND:> ABOR
STATUS:> Received 0 bytes, Abnormal termination
COMMAND:> CWD /www
226-Options: -l
226 8 matches total
STATUS:> Retrieving directory listing...
COMMAND:> PASV
226 Since you see this ABOR must've succeeded
STATUS:> Error opening data socket
STATUS:> Receiving: cgiperl.htm --> c:\junk\cgiperl.htm
COMMAND:> PASV
250 OK. Current directory is /www
STATUS:> Error opening data socket
STATUS:> Failed to receive cgiperl.htm
Abort is a procedure that instructs the FTP server to interrupt the previous FTP service command, and any associated transfer of data. Abort does not affect the control connection for the FTP client, but forces the data connection to be closed.