tumblr tracker

Download

Library Reference ›› FTP ››
Parent Previous Next

FTP.Download


Namespace: FTP


Downloads a directory or file from the FTP server. If the Path is FTP directory the full structure will be downloaded, including any files and subdirectories.


retval = FTP.Download(FtpClient, ServerPath, LocalPath)


Parameters:

- FtpClient; a handle variable returned from a previous call to CreateFtpClient;

- ServerPath; string constant or variable containing the slash delimited FTP path to download

- LocalPath; string constant or variable containing the local destination path to place the download in


Returns:

true if download succeeded or false otherwise; boolean value.


Example


$FtpClient = FTP.CreateFtpClient("moscripto.com", 21, "moscriptoftpdemo", "demopass");

if (Error.IsError())
{
   MessageBox.ShowError(Error.GetErrorMessage());
   Error.ClearError();
}
Else
{
   FTP.Download($FtpClient, ""/*FTP root*/, "C:\TEMP\MoscriptoTest");
   
   If (Error.IsError())
   {
       MessageBox.ShowError(Error.GetErrorMessage());
       Error.ClearError();
   }
   Else {
       MessageBox.ShowInfo("FTP download succeeded.");  
   }
   
   FTP.DestroyFtpClient($FtpClient);
}