FTP protocol (instruction set)

Source: Internet
Author: User
Tags rfc ftp protocol

FTP protocol uses a series of simple protocols to complete the file transfer of various tasks, when sending commands, always at the end of the command plus a carriage return line character, in VB can be "vbCrLf" to achieve, VC in the "/r/n" said. The following commands are modified from RFC 929 in Postel and Reynolds, and if the reader wants to see the details, please refer to the English version of RFC 929. Note that the following occurrence of the symbol CRLF is a carriage return symbol, that is, the equivalent of VC "/r/n". 1. Abot (Abort, abort) Order

Description: Tells the server to abort the last FTP service command and all associated data transfers.

Usage: Abor﹝crlf﹞

Parameters: None.

Example:

SendData "Abor" + "/r/n"

Note: The Abort command can request "special operations" to force the attention of the server (see RFC959 for details). If the last command has been completed (including data transfer), it will not cause any action. The server does not close the control connection, but the data connection must be turned off.

The server may be in two states when it receives this command: (1) The FTP service command has been completed, (2) The FTP service command is still being processed.

In the first state, the server closes the data connection (if it is open) and responds with a 226 response, indicating that the abort command was executed successfully.

In the second state, the server aborts the FTP service in process and closes the data connection, returning a 426 response indicating that the service request was terminated abnormally. The server then sends a 226 response, indicating that the abort command was executed successfully.

L 225 data Connection open, no ongoing transmissions

L 226 Closes the data connection and the requested file operation is successful.

L 421 Service Unavailable, close control connection.

If a service learns that it is about to close, the answer is made to all commands.

L 226 Connection closed, transmission terminated.

L 500 syntax error, command not recognized.

This includes errors such as the command line being too long.

There are syntax errors in the L 501 parameter or variable.

The L 502 command has not been implemented yet. 2. ACCT (account, accounts) command

Description: Specifies the user's account information. This command can only be sent after the pass command is sent and 332 code is received.

Usage:acct<account><crlf>

Parameter: Account is the user's accounts and may require additional access to certain services.

Example:

SendData "acctn322s" + "/r/n

Note: When the login requires account information, a successful pass command response is reply code 332. Conversely, if the login does not require account information, the success of the pass command response is 230; If the subsequent command in the conversation requires account information, the server returns 332 or 532 responses, depending on whether it is saved (during the receive ACCT command) or discards the command.

Return value (bold indicates success):

The L 202 command has not been implemented and is redundant on this site.

L 230 The user is logged in, please continue.

L 421 Service Unavailable, close control connection.

If a service learns that it is about to close, the answer is made to all commands.

L 500 syntax error, command not recognized.

This includes errors such as the command line being too long.

There are syntax errors in the L 501 parameter or variable.

The L 502 command has not been implemented yet.

The order of the L 503 command is not correct.

L 530 cannot log in. 3. ALLO (Allocate, distribution) Order

Note: Allocate x bytes on the server before sending the file

Usage:allo<numberbytes[<maxsize>]<crlf>

Parameter: Numberbytes is an integer that represents the number of bytes of memory reserved for the file (calculated using logical byte size). MaxSize is the maximum record or page size that is optional when using a record or page data structure.

Example:

SendData "ALLO 3000 128" + "/r/n

Note: This command is requested for services that retain enough memory to accommodate new files that will be transferred. The maximum record or page size (in logical bytes) may also be required for a file sent with a record or page structure, which is represented by a decimal integer in the second parameter field of the command. This second parameter is optional, but should be separated from the first parameter three ASCII characters <SP>P<SP>. This command is followed by a store or append command. Servers that do not require the maximum file size to be declared in advance should treat the Allo command as NOOP (not operate), while servers that care only for the maximum record or page size should be subject to the value of the first parameter, and then ignore it.

Return value (bold indicates success):

L 200 Command succeeded.

The L 202 command has not been implemented and is redundant on this site.

L 421 Service Unavailable, close control connection.

If a service learns that it is about to be closed, it will make this response to all commands.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.