Setting or Retrieving Advanced Settings

Use the Option property to set or retrieve various settings, such as Auto-rename, include folder names when filtering, cache invalidation, error handling, cleaning up of asynchronous tasks, and to auto-close prompts.

Syntax

String Object.Option("[option name]") = true | false

Parameters

"ThrowError"

(defaults to True) - TE COM will call AtlReportError (showing a VB runtime error message box) on connection/transfer/IO/other error which will terminate script execution. If set to False, then if some transfer method fails the script will continue to the next command.

"AutoRename"

(defaults to False) - The same as the AutoRename property.

"CleanupAsync"

(defaults to True) - All task IDs accumulated by previous Async methods will be lost. If set to False, all task IDs will be added to the ones created by previous Async methods.

"InvalidateCache"

(defaults to True) - Remove cached file (containing listings) before uploading, downloading, renaming or deleting files. If false, then don't remove cached listing. You can obtain the specific file information when needed by using one of the file property methods. InvalidateCache optimizes LIST traffic.

"FilterDirs"

(defaults to True) - Apply filters to folder names. If set to False, then don't apply.

"AutoCloseMethod"

(default to 0) 1 - auto accept, 2 - auto reject, 0 - Don't accept (default). This handles hidden prompts (such as SSL Accept Cert Prompt when running a script while not logged in).

"AutoCloseDelay"

(default value is 60 seconds). Time delay before CuteFTP should perform the action specified by the AutoCloseMethod option.

Example 1

Set MySite = CreateObject("CuteFTPPro.TEConnection")

MySite.Host = "ftp://ftp.cuteftp.com"

MySite.Option("FilterDirs")=False          'don't filter folder names

MySite.LocalFilterExclude= "TDImon; *.txt; *.vbs"

                                           'now set the item names to exclude MySite.Upload "c:\test"

                                           'uploads all of test including sub dirs.

                                           'Even sub dirs that match the filter, such as TDIMon.

                                           'If I had left FilterDirs=True, then the folter

                                           'TDImond would not have been uploaded.

Example 2

Set MySite = CreateObject("CuteFTPPro.TEConnection")

MySite.Host = "ftp://ftp.somestrangedomain.com"

MySite.Option("ThrowError") = false

if not CBool(MySite.Connect) then

  MsgBox "Error : " & MySite.ErrorDescription

end if

Example 3

Set MySite = CreateObject("CuteFTPPro.TEConnection")

MySite.Host = "ftps://ftp.asecuredomain.com"

MySite.Option("AutoCloseMethod") = 1  'will auto accept cert and continue

MySite.Option("AutoCloseDelay") = 5   'wait 5 seconds before accepting

MySite.Connect                        'now connect to the secure site. The TE will accept the server's SSL cert after 5 seconds and continue executing the rest of the script.