tumblr tracker

Upload

Library Reference ›› FTP ››
Parent Previous Next

FTP.Upload


Namespace: FTP


Uploads a local file or folder to the FTP server. If the LocalPath is a folder the full structure will be uploaded, including any files and subfolders.


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


Parameters:

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

- LocalPath; string constant or variable containing the local source path to read from

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


Returns:

true if the upload 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.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);
}