|Purpose:||Open or close an FTP / FTPS / SFTP session|
|Format:||IFTP [/= /S command /C /EP /IPv6 /N /Pn /PR="n" /Q /R /V /Z[n]] ["ftp://[user[:password]@]server[/path][:port]"]|
|user||The user name to login to the FTP site|
|password||The password to login to the FTP site.|
|server||The FTP server name.|
|path||The default directory on the server for this session.|
/EP (extended passive)
/PR="n" (port range)
Most file processing commands and functions in TCC can access files on FTP servers in the same manner as files on local hard drives and a local network. Normally, each time you use the FTP feature of one of these commands or functions, it repeatedly starts an FTP session, performs an individual operation, and closes the FTP session, until the command or function is finished.
IFTP starts an FTP session which remains open until you close it or it is closed by the remote server. There are several advantages to using IFTP: the FTP connection remains open so commands execute more quickly, the syntax for accessing files on the server is shorter, and you can specify a default directory on the server for file operations.
For example, to open an FTP connection using IFTP:
For an FTPS connection, use something like:
This command tells IFTP to open an FTP/FTPS session with the server myserver.com, send user as the login username and password as the login password, and to establish the directory /dir1 as the default directory for this session. The user name and password are optional; if they are not used, IFTP will attempt to log in anonymously. Double quotes are required if there are spaces or special characters in the filename. If you specify a password of *, you will be prompted to enter the password (which will appear on the screen as asterisks).
Note that in the example above dir1 is a subdirectory of the FTP "root" directory -- the home directory for the named FTP user. In most server configurations this is not the same as the FTP server's physical root directory.
Note: If you enter IFTP with no parameters while a connection is active, the current server name and directory will be displayed.
If you enter IFTP with only the /Q or /V switch, you change the amount of information displayed without disturbing the existing connection (if any).
Once you have established an FTP session with IFTP, you can refer to files on the server by using ftp: (or ftps:) but leaving out the user name, password, and URL of the server. On most servers, file and path names which begin ftp: are relative to the default directory, if any, that you specified when you opened the IFTP session; file and path names which begin ftp:/ are relative to the root directory for the login name.
The difference can be seen in these four DIR commands, assuming the IFTP session started above:
1. dir "ftp:*.txt"
2. dir "ftp:dir2/*.txt"
3. dir "ftp:/*.txt"
4. dir "ftp:/dir2/*.txt"
The first command lists the .TXT files in the default session directory, dir1. The second command lists the .TXT files in /dir1/dir2 because it interprets the path dir2/*.txt to be relative to the default directory. The quotes could be omitted from example 1 because it contains no forward slash that could be mistaken as an option switch. The third and fourth commands above, because they include a / immediately following the ftp: designator, are relative to the root directory. Command 3 lists the .TXT files in the root directory and command 4 lists the files in the dir2 subdirectory of the root directory.
Note: If an ftp file or path specification begins with a ~ (tilde), TCC will not attempt to build a full directory name but will instead pass the entire string to the remote server.
You can only have one IFTP connection open at a time within a TCC tab window. However, while you have an IFTP connection open, you can still use a complete FTP URL to perform an operation on a different server. For example, while the session above is open, you can use this command to display all files in the root directory of microsoft.com:
An IFTP session remains open until you explicitly close it with this command:
Most FTP servers "time out" after a period of inactivity. TCC will attempt to detect if the connection has been closed by the server, and reconnect if you reference the IFTP session again. You should not assume that an IFTP connection will continue to function if you leave it open but unused for a significant period of time. You can determine if the connection is still active with the _iftp, _iftps, and _isftp variables.
IFTP and the other FTP features of TCC rely on the server's compliance with Internet FTP standards. If your server is not fully compliant, or does not operate in the manner that TCC expects, commands may not work as you intend. We urge you to test each server you use with nondestructive commands like DIR before you try to copy or delete files, create or remove directories, etc.
Before you can use IFTP, you must establish the necessary connection to the Internet.
|/=||Display the IFTP command dialog to help you set the command line options. You cannot specify any other arguments on the command line.|
|/IPv6||By default, IFTP expects an IPv4 address for the local and remote host, and will create an IPv4 socket. The /IPv6 option tells IFTP to use IPv6 instead. (Works with FTP, FTPS, and SFTP connections.)|
|/N||Pass both source and target names to the server "as is" without any attempt at expanding the paths. This option should be used with caution and only for "non standard" servers for which the default processing fails to build a suitable name.|
|/PR="n"||When using active mode, IFTP uses any available port to listen to incoming connections from the server. You can override this behavior by setting /PR (PortRange) to a value containing the range of ports the class will be listening to. The range is provided as start-end, for instance: "1024-" stands for anything higher than 1024, "1024-2048" stands for ports between 1024 and 2048 inclusive, "4000-4010, 50000-50010" stands for ports between 4000 and 4010 or between 50000 and 50010. (Works with FTP and FTPS, but not SFTP.)|
|/S||Allows you to send commands directly to an FTP server. The connection must have already been opened by a previous IFTP command.|
|/V||Display the dialog with the FTP server while opening the connection. This can be useful for debugging connection problems.|
|/Zn||Use Zlib compression. You can optionally set the compression level (0-9; the default is 7). Zlib compression must be enabled on the server, and will only work with FTP and FTPS connections (not SFTP).|
See FTP Servers for additional information on formatting and usage of FTP and FTPS references.