#FTPTimeout – System Variable






#FTPTimeout Documentation


Description

The #FTPTimeout system variable specifies the number of seconds which WinTask should wait before reporting an execution error when it tries to execute a FTP function.

Usage

Used to increase the delay before an execution error is reported. For example, if a big file is downloaded from the FTP server to the local machine, the default timeout of 30 seconds will stop the transfer. So before invoking the FTPGetFile function, add a line:

#FTPTimeout=120

If the file downloads in less than 120 seconds.

Syntax

#FTPTimeout=<value>

Parameters

<value>, integer, number of seconds for the FTP timeout.

Remarks

If a FTP function execution is not finished after #FTPTimeout seconds, Error Handling mechanism is used.

The default value for #FTPTimeout is 30 seconds.

If #FTPTimeout is set to 0, WinTask waits forever.

See also

FTP Functions

Examples

#FTPTimeout = 5

'This script downloads wintaskdemo.exe from www.wintask.com FTP server (the password is not correct on purpose!).
#IgnoreErrors=1    'No error is displayed if an execution error occurs

#FTPTimeout=120   'Allow a maximum of 120 seconds for FTP functions execution

FtpConnect("www.wintask.com","ftp","PMJN1563hSWHXFj/CD")   'Connect to the FTP server

ret=FTPGetFile("c:\wttest","/wintaskdemo.exe")  ' Download wintaskdemo.exe from the FTP server and save it under c:\wttest
' Test the return code
if ret=0 then
    msgbox("Download done")
else
    msgbox("Increase the timeout")
endif

FtpDisconnect() ' Terminates the FTP connection