Home > Language Reference > FTP Functions > FTPChDir

FTPChDir

The FTPChDir function specifies the new FTP current folder.

Usage

Used to change the current working folder on the FTP server.

Syntax

ret=FTPChDir(<target_foldername>)

Parameters

<target_foldername>, string, path to the folder to change to (on the currently connected FTP server).

Return value

Ret, optional numeric return value. If the function succeeds changing the folder within 30 seconds (this default value can be changed using #FTPTimeout , the function returns 0. If the function fails, the return value is a nonzero negative value (see FTP Functions Error Codes).

See also

FTPExistDir
FTPMkDir
FTPRmDir

Example

FtpConnect("www.my_site.com","ftp","MX/WH05CZE3H") 'connection to the FTP server (fake credentials!)
FtpCurrentDir(var$) ' var$ contains /
FtpChDir("upgrades") ' change the current folder to /upgrades
FtpCurrentDir(var$) ' var$ contains /upgrades
msgbox(var$)
FtpDisconnect() ' Terminates the FTP connection