SETPORT

Set the server port used for connecting.

Syntax: SETPORT(port)

  • port: port number.

Remarks:
Changes will take effect the next time OPENHOST is invoked in the script.

See also:
OPENHOST
SETPROTOCOL

Return value:
This command always returns "OK".

Examples:

# Connect to ftp.myhost.com using port 65002
SETPORT(65002)
OPENHOST("ftp.myhost.com","myuser","mypassword")

# Download all files and disconnect
GETFILE("*.*")
CLOSEHOST

# Connect to ftp.myhost.com using
# implicit FTPS on the 3024 port
SETPROTOCOL(FTPS_IMPLICIT)
SETPORT(3024)
OPENHOST("ftp.myhost.com","myuser","mypassword")

# Download all files and disconnect
GETFILE("*.*")
CLOSEHOST