ChangeDirectory Method

Changes current directory on remote FTP server.

Syntax

object.ChangeDirectory( Path )

The object placeholder represents an expression that evaluates to a FileTransfer object.

Return Type

Integer

Remarks

The ChangeDirectory method changes the current working directory on the remote server. This method updates the ServerDirectory property to reflect the new path.

The Path argument specifies the directory on the remote server.

A value of zero is returned if the operation was successful, otherwise a non-zero error code is returned which indicates the cause of the failure.

Example

Private Sub cmdChgDir_Click()
    Dim nError As Long
    
    nError = FileTransfer1.ChangeDirectory(Trim(txtServerDirectory.Text))
    If nError <> 0 Then
        MsgBox "ChangeDirectory error: " & nError
    End If 
    txtServerDirectory.Text = FileTransfer1.ServerDirectory
End Sub

See Also

ServerDirectory Property


Copyright © 2008 Catalyst Development Corporation. All rights reserved.