Dart Ftp Control
ChangeDirectoryUp Method
Description
Set the working directory to the parent directory. The Directory property can be checked to discover the new working directory.
Syntax
Visual Basic
Public Sub ChangeDirectoryUp() 
Remarks

Sends the ftpChangeDirectoryUp command.

If Timeout is greater than 0, ChangeDirectoryUp blocks until a reply is received from the server or a ptTimeout error occurs.

If Timeout is 0, ChangeDirectoryUp immediately returns and the Progress event fires with FtpCmd = ftpChangeDirectoryUp when the reply is received.

Error Codes

This method may generate the following error code (refer to ErrorConstants for a complete list of error codes):

Example
Private Sub cmdDirectoryTest_Click()
     ' this shows directory manipulation using the Ftp Control
     ' login to the ftp server
     Ftp1.Login "www.testserver.com", "Administrator", "123456"
     ' print current directory, should be '/'
     Debug.Print Ftp1.Directory
     ' create a new directory
     Ftp1.MakeDirectory "tempdir"
     ' set directory to newly created dir
     Ftp1.Directory = "tempdir"
     ' print current directory, should be '/tempdir'
     Debug.Print Ftp1.Directory
     ' change back to parent dir
     Ftp1.ChangeDirectoryUp
     ' print current directory, should be '/'
     Debug.Print Ftp1.Directory
     ' delete directory
     Ftp1.RemoveDirectory "tempdir"
     ' attempt to change to deleted dir will result in error
     Ftp1.Directory = "tempdir" ' !error
End Sub
See Also

Ftp Object  | Ftp Members


PowerTCP FTP for ActiveX Documentation Version 2.2
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic