FtpStatusCode FtpStatusCode FtpStatusCode FtpStatusCode Enum

Definition

Specifies the status codes returned for a File Transfer Protocol (FTP) operation.

public enum class FtpStatusCode
public enum FtpStatusCode
type FtpStatusCode = 
Public Enum FtpStatusCode
Inheritance
FtpStatusCodeFtpStatusCodeFtpStatusCodeFtpStatusCode

Fields

AccountNeeded AccountNeeded AccountNeeded AccountNeeded 532

Specifies that a user account on the server is required.

ActionAbortedLocalProcessingError ActionAbortedLocalProcessingError ActionAbortedLocalProcessingError ActionAbortedLocalProcessingError 451

Specifies that an error occurred that prevented the request action from completing.

ActionAbortedUnknownPageType ActionAbortedUnknownPageType ActionAbortedUnknownPageType ActionAbortedUnknownPageType 551

Specifies that the requested action cannot be taken because the specified page type is unknown. Page types are described in RFC 959 Section 3.1.2.3

ActionNotTakenFilenameNotAllowed ActionNotTakenFilenameNotAllowed ActionNotTakenFilenameNotAllowed ActionNotTakenFilenameNotAllowed 553

Specifies that the requested action cannot be performed on the specified file.

ActionNotTakenFileUnavailable ActionNotTakenFileUnavailable ActionNotTakenFileUnavailable ActionNotTakenFileUnavailable 550

Specifies that the requested action cannot be performed on the specified file because the file is not available.

ActionNotTakenFileUnavailableOrBusy ActionNotTakenFileUnavailableOrBusy ActionNotTakenFileUnavailableOrBusy ActionNotTakenFileUnavailableOrBusy 450

Specifies that the requested action cannot be performed on the specified file because the file is not available or is being used.

ActionNotTakenInsufficientSpace ActionNotTakenInsufficientSpace ActionNotTakenInsufficientSpace ActionNotTakenInsufficientSpace 452

Specifies that the requested action cannot be performed because there is not enough space on the server.

ArgumentSyntaxError ArgumentSyntaxError ArgumentSyntaxError ArgumentSyntaxError 501

Specifies that one or more command arguments has a syntax error.

BadCommandSequence BadCommandSequence BadCommandSequence BadCommandSequence 503

Specifies that the sequence of commands is not in the correct order.

CantOpenData CantOpenData CantOpenData CantOpenData 425

Specifies that the data connection cannot be opened.

ClosingControl ClosingControl ClosingControl ClosingControl 221

Specifies that the server is closing the control connection.

ClosingData ClosingData ClosingData ClosingData 226

Specifies that the server is closing the data connection and that the requested file action was successful.

CommandExtraneous CommandExtraneous CommandExtraneous CommandExtraneous 202

Specifies that the command is not implemented by the server because it is not needed.

CommandNotImplemented CommandNotImplemented CommandNotImplemented CommandNotImplemented 502

Specifies that the command is not implemented by the FTP server.

CommandOK CommandOK CommandOK CommandOK 200

Specifies that the command completed successfully.

CommandSyntaxError CommandSyntaxError CommandSyntaxError CommandSyntaxError 500

Specifies that the command has a syntax error or is not a command recognized by the server.

ConnectionClosed ConnectionClosed ConnectionClosed ConnectionClosed 426

Specifies that the connection has been closed.

DataAlreadyOpen DataAlreadyOpen DataAlreadyOpen DataAlreadyOpen 125

Specifies that the data connection is already open and the requested transfer is starting.

DirectoryStatus DirectoryStatus DirectoryStatus DirectoryStatus 212

Specifies the status of a directory.

EnteringPassive EnteringPassive EnteringPassive EnteringPassive 227

Specifies that the server is entering passive mode.

FileActionAborted FileActionAborted FileActionAborted FileActionAborted 552

Specifies that the requested action cannot be performed.

FileActionOK FileActionOK FileActionOK FileActionOK 250

Specifies that the requested file action completed successfully.

FileCommandPending FileCommandPending FileCommandPending FileCommandPending 350

Specifies that the requested file action requires additional information.

FileStatus FileStatus FileStatus FileStatus 213

Specifies the status of a file.

LoggedInProceed LoggedInProceed LoggedInProceed LoggedInProceed 230

Specifies that the user is logged in and can send commands.

NeedLoginAccount NeedLoginAccount NeedLoginAccount NeedLoginAccount 332

Specifies that the server requires a login account to be supplied.

NotLoggedIn NotLoggedIn NotLoggedIn NotLoggedIn 530

Specifies that login information must be sent to the server.

OpeningData OpeningData OpeningData OpeningData 150

Specifies that the server is opening the data connection.

PathnameCreated PathnameCreated PathnameCreated PathnameCreated 257

Specifies that the requested path name was created.

RestartMarker RestartMarker RestartMarker RestartMarker 110

Specifies that the response contains a restart marker reply. The text of the description that accompanies this status contains the user data stream marker and the server marker.

SendPasswordCommand SendPasswordCommand SendPasswordCommand SendPasswordCommand 331

Specifies that the server expects a password to be supplied.

SendUserCommand SendUserCommand SendUserCommand SendUserCommand 220

Specifies that the server is ready for a user login operation.

ServerWantsSecureSession ServerWantsSecureSession ServerWantsSecureSession ServerWantsSecureSession 234

Specifies that the server accepts the authentication mechanism specified by the client, and the exchange of security data is complete.

ServiceNotAvailable ServiceNotAvailable ServiceNotAvailable ServiceNotAvailable 421

Specifies that the service is not available.

ServiceTemporarilyNotAvailable ServiceTemporarilyNotAvailable ServiceTemporarilyNotAvailable ServiceTemporarilyNotAvailable 120

Specifies that the service is not available now; try your request later.

SystemType SystemType SystemType SystemType 215

Specifies the system type name using the system names published in the Assigned Numbers document published by the Internet Assigned Numbers Authority.

Undefined Undefined Undefined Undefined 0

Included for completeness, this value is never returned by servers.

Examples

The following code example sends an FTP request to make a new directory on an FTP server and checks the status code returned in the response.

static bool MakeDirectoryOnServer( Uri^ serverUri )
{
   // The serverUri should start with the ftp:// scheme.
   if ( serverUri->Scheme != Uri::UriSchemeFtp )
   {
      return false;
   }

   // Get the object used to communicate with the server.
   FtpWebRequest^ request = dynamic_cast<FtpWebRequest^>(WebRequest::Create( serverUri ));
   request->Method = WebRequestMethods::Ftp::MakeDirectory;
   FtpWebResponse^ response = dynamic_cast<FtpWebResponse^>(request->GetResponse());
   Console::WriteLine( "Status: {0}", response->StatusDescription );
   return true;
}
public static bool MakeDirectoryOnServer (Uri serverUri)
{
    // The serverUri should start with the ftp:// scheme.
    if (serverUri.Scheme != Uri.UriSchemeFtp)
    {
        return false;
    }

    // Get the object used to communicate with the server.
    FtpWebRequest request = (FtpWebRequest)WebRequest.Create (serverUri);
    request.KeepAlive = true;
    request.Method = WebRequestMethods.Ftp.MakeDirectory;
    FtpWebResponse response = (FtpWebResponse)request.GetResponse ();
    Console.WriteLine ("Status: {0}", response.StatusDescription);
    return true;
}

Remarks

The FtpStatusCode enumeration defines the values returned in the StatusCode property.

For additional information about FTP server status codes, see RFC 959: "File Transfer Protocol", Section 4.2: "FTP Replies".

Applies to

See also