tumblr tracker

CreateFtpClient

Library Reference ›› FTP ››
Parent Previous Next

FTP.CreateFtpClient


Namespace: FTP


Creates an FTP client handle that can be used to connect to an FTP server and transfer files.


retval = FTP.CreateFtpClient(Host, [Port], [Username], [Password])


Parameters:

- Host; a string constant or variable containing FTP server host name or IP address

- [Port]; optional; a numeric constant or variable defining the FTP port to connect to; default is 21

- [Username]; string constant or variable containing a valid FTP username

- [Password]; string constant or variable


Returns:

FTP client handle; handle value.


Example


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

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