|
Summary
Contains the last reply code from the server
Description
The LastResult property contains the result of the last operation on the FTP server in response to the most recent client request. The property can have any one of the following values.
| Value |
Meaning |
| FTP_OK |
Operation completed successfully. |
| FTP_ERROR |
Operation could not be completed. |
| FTP_CONN_CLOSED |
Connection was closed by server. |
| FTP_NO_ENTRY |
Too many FTP connections open. |
| FTP_BAD_FILE_TYPE |
File type is incorrect. |
| FTP_NOT_CONNECTED |
Connection was reset. |
| FTP_BAD_ARGUMENT |
Incorrect argument specified. |
| FTP_BAD_COMMAND |
Incorrect command specified. |
| FTP_FILE_ERROR |
Error during file transfer. |
| FTP_DATA_CONN_ERR |
Error opening data connection. |
| FTP_ACCEPT_ERR |
Error accepting data connection. |
| FTP_REPLY_TIMEOUT |
Timed out waiting for a reply. |
| FTP_ACCEPT_TIMEOUT |
Timed out waiting for data connection. |
| FTP_SEND_TIMEOUT |
Timed out during send operation. |
| FTP_CANCELLED |
Transfer aborted. |
| FTP_BUSY |
FTP server is busy. |
| FTP_DATA_TIMEOUT |
Timed out waiting for data. |
| FTP_INVALID_HOSTNAME |
Specified host name is not valid. |
| FTP_CONNECT_ERROR |
Error in connecting to remote host. |
| FTP_ASYNC_ERROR |
Error in enabling asynchronous notification. |
| FTP_MAX_CONNECTIONS |
Cannot open any more connections. |
| FTP_OOB_ERROR |
Error in handling urgent data options for the control port. |
If a different value than those listed above appears, then an error occurred while the server was executing the command. The LastResult property will contain the reply code from the FTP server. Some
of the reply codes are listed below. For more information about the reply codes, please refer to RFC 959 - "File Transfer Protocol (FTP)".
| Value |
Meaning |
| 500 |
Syntax error, command unrecognized, command line too long. |
| 501 |
Syntax error in parameters or arguments. |
| 502 |
Command not implemented. |
| 503 |
Bad sequence of commands. |
| 504 |
Command not implemented for that parameter. |
| 530 |
Not logged in. |
| 532 |
Need account for storing files. |
| 550 |
Requested action not taken (file not found, no access). |
| 551 |
Requested action aborted (page type unknown). |
| 552 |
Requested file action aborted (exceeded storage allocation). |
| 553 |
Requested action not taken (file name not allowed). |
The LastResult property reflects the result of the last operation caused by setting the Action, DirAction, FileAction or TransferType (if connected) properties (or by calling the equivalent method).
The value of this property should be checked immediately after each operation. Calling other methods or setting other properties may change the value of the property.
This property can be read at any time. There is no default value for this property.
Example
FTPClient.RemoteFile = "test.exe" FTPClient.LocalFile = "c:\test.exe" FTPClient.FileAction = FILE_ACTION_GET If FTPClient.LastResult
<> FTP_OK Then MsgBox "Unable to transfer file", 64, "Sample Program" End If
|