| How to change directories |

While you are connected to an FTP server, the server keeps track of your working directory. The server assumes you are referring to this directory whenever you perform a file operation without specifying an absolute path. In fact many FTP servers do not support the use of absolute paths.
The current working directory is available by calling the getRemoteDirectory() method:
string directory = ftp.getRemoteDirectory();
This may be changed using:
ftp. changeDirectory(directory);
Or to simply go up to the parent directory:
ftp. changeToParentDirectory();