ftp_upload_file

execute ibeblock(
   HostName variant,
   UserName variant,
   Pwd variant,
   RemoteDir variant,
   LocalFileName variant,
   RemoteFileName variant,
   SessionLogFN variant)
as
begin
  ftp = ibec_ftp_OpenSession('');
  try
    ibec_ftp_SetProperty(ftp, 'HostName', HostName);
    ibec_ftp_SetProperty(ftp, 'UserName', UserName);
    ibec_ftp_SetProperty(ftp, 'Password', Pwd);
 
    ibec_ftp_SetProperty(ftp, 'PassiveMode', FALSE);
    --ibec_ftp_SetProperty(ftp, 'TransferMode', 'AUTO');
    --ibec_ftp_SetProperty(ftp, 'TransferMode', 'ASCII');
    --ibec_ftp_SetProperty(ftp, 'TransferMode', 'BINARY');

    Res = ibec_ftp_Connect(ftp);
    if (Res) then
    begin
      Res = ibec_ftp_ChangeDir(ftp, RemoteDir); 

      if (Res) then
        Res = ibec_ftp_PutFile(ftp, LocalFileName, RemoteFileName);
    end
 
    SessionLog = ibec_ftp_GetProperty(ftp, 'SessionLog');
    ibec_SaveToFile(SessionLogFN, SessionLog, __stfOverwrite);

  finally
    ibec_ftp_CloseSession(ftp);
  end; 
end;