Using FTP and HTTP Servers

TCC-RT allows direct access to remote servers from internal commands such as COPY, DEL, DIR, MOVE, MD, RD, REN, and SELECT via several protocols:

 

OnestepFTP (basic FTP)
OnestepTFTP (Trivial FTP)
OnestepFTPS (SSL FTP)
OnestepSFTP (SSH FTP)
OnestepHTTP (basic Web access)
OnestepHTTPS (SSL HTTP)

 

Note: Not all protocols are supported in every internal command. For example, DIR will not work with HTTP or HTTPS (because of limitations in the HTTP / HTTPS protocol).

 

FTP support:

 

The basic filename syntax for anonymous connections is:

 

ftp://ftp.abc.com/...

 

For example, to get a directory of the Microsoft FTP site, you could use this command:

 

dir ftp://ftp.microsoft.com/*

 

If you don't specify a username and password, TCC-RT will look for your FTP user names and passwords in the file FTP.CFG (which defaults to the Take Command directory). You can specify another directory with the FTP.CFG configuration option. You must add entries to the FTP.CFG file manually. The format for each line is:

 

    url [(alias)] username password [directory template]

 

For example:

 

ftp://ftp.jpsoft.com fred secret

ftp://ftp.microsoft.com anyone mypassword

 

You can have multiple users for a single FTP site (for example, an admin user and and a normal user). You need to add an alias (enclosed in parentheses) following the name of the ftp site. For example:

 

ftp://ftp.jpsoft.com (jpadmin) Bob AdminPassword

ftp://ftp.jpsoft.com (jppublic) anonymous Bob@ftp.jpsoft.com

 

You can then access the server as ftp://jpadmin or ftp://jppublic.

 

We recommend you encrypt this file if you're using NTFS. If FTP.CFG  doesn't exist the first time TCC-RT looks for it, it will be created as an encrypted file (NTFS only). Note: If you are using FAT /  VFAT, the file will not be encrypted and your user names and passwords will be unprotected in plain text.

 

You can also specify an explicit username and password on the command line:

 

ftp://[username:password@]ftp.abc.com/...

 

If you specify a password of *, you will be prompted to enter the password (which will appear on the screen as asterisks). Depending on the type of operation you're doing, you may need to enter the password multiple times as TCC-RT repeatedly connects and disconnects from the server. To avoid this, use IFTP (which will also be much faster).

 

If you have FTP permission on server ftp.abc.com and a subdirectory of the root directory on that server is called mydir, you can display the files with this command (enter this on one line):

 

dir ftp://username:password@ftp.abc.com/mydir/*

 

You can also use the internal IFTP command to start an FTP session with a server and then use a simplified syntax to manipulate files on the server.

 

TCC-RT also supports symbolic hostnames (defined in \windows\system32\drivers\etc\hosts).

 

TCC-RT normally connects to the FTP server on the default FTP port 21. If the FTP server you are connecting to uses a non-standard port, enter the port number (with a preceding colon) just after the server name, for example:

 

dir ftp://username:password@ftp.abc.com:8765/mydir/*

 

To log on to a server which supports "anonymous" logins, enter the required user name (usually "anonymous") and password (usually your email address) using the syntax shown above, for example:

 

dir ftp://anonymous:email@domain.com@ftp.microsoft.com/

 

TCC-RT will distinguish between the @ in the email address and the @ before the server name in order to separate the parts of the URL properly.

 

If you use a partial file or path reference, such as

 

dir ftp:myfile.txt

 

TCC-RT will attempt to build a fully qualified directory name in which to find the requested file or path, based on what the server reports as the current working directory. If an ftp file or path specification begins with a ~ (tilde, typically indicative of a path relative to the user's home directory), TCC-RT will instead pass the exact string directly to the remote server.

 

TCC-RT uses standard FTP commands to retrieve information about files and directories and manipulate those files and directories on FTP servers, and relies 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-RT expects, the results may not be what you intend. For example, if the FTP server you are connecting to is case-sensitive, you may have to use the stored case of file and directory names when you use FTP commands. (If you include wildcards in the filename, TCC-RT will match filenames regardless of case.) 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.

 

Time-related operations (e.g. switches like COPY /C or /U) may not always work reliably on FTP and HTTP servers, due to differences in time zone and in the file time representations between your local system and the server. Be sure to experiment with the particular server in question before depending on commands which compare file times to yield the results you want.

 

Note: If you use a partial reference such as ftp:mydir outside the scope of an IFTP command, TCC-RT will attempt to re-establish the last connection, if any. That new connection may or may not be logged to the last used directory on that sever. We recommend you always use a full reference (including server name)  unless you are specifically taking advantage of an active IFTP connection. You can determine if there is an active IFTP connection with the _iftp and _iftps variables.

 

Before you can use the built-in FTP support or the IFTP command, you must establish the necessary connection to the Internet. For example, if you use Windows Dial-Up Networking to connect to the Internet, you must start your dial up connection first. If you connect through a proxy server, you must set the Proxy configuration options.

 

TCC-RT will try to preserve timestamps when transferring files. The MDTM command is used when downloading, and the MFTM command is used when uploading. If the FTP server doesn't support these commands, TCC-RT will use the current date/time for the timestamp.

 

Non-standard FTP servers:

 

TCC-RT supports directory formats for the following:

 

EPLF

WFTP

VMS (single-line filenames only)

NetPresenz (Macintosh)

Netware

All known UNIX and Linux formats

Windows FTP Server

 

If you have a non-standard FTP server that creates an unusual directory format, you can create an entry in your FTP.CFG file to allow TCC-RT to parse the FTP server output. The format is described in the FTP.CFG following the host name,  username, and password. The format characters are:

 

I"text"Do a wildcard comparison of "text" and the directory line; if it matches, discard the entire line. (This is to allow you to skip header & footer lines that would otherwise return garbage.)

 

"text"Compare (and skip) a literal string (does NOT support wildcard searches)

 

<space>Skip whitespace (spaces, tabs)

 

!Skip non-whitespace

 

-Ignore a single character

 

FFilename. If the F is followed by a . (i.e., "F."), the extension is the next non-whitespace string. The extension will be appended (preceded by a '.') to the filename.

 

SSubdirectory flag. If the S is followed by a =, the next character is the character in a "raw" directory listing that denotes a directory. If you don't specify a =, 'D' is assumed.

 

TMonth as a string (i.e., "Jan", "Feb", etc.)

 

ULinux-style year (2004) or time (18:30) in the same field.

 

YYear                        

 

MMonth

 

DDay

 

hHour

 

mMinute

 

Ha or p (for am/pm)

 

ZFile size. If the Z is followed by a =, the number following that is the block size.

 

(Note that upper/lower case is significant for the format characters.)

 

For example, the FTP.CFG entry for JPSOFT.COM can be described as:

 

jpsoft.com anonymous JPUser@ S ! ! ! Z T D U F

 

TFTP ("trivial FTP") support:

 

See the FTP section above for general notes and requirements.

 

TFTP is only available with COPY (and with MOVE when the source is a local file). The  syntax is:

 

tftp://server[:port]/filename

 

For example:

 

copy update tftp://190.189.188.0/update

 

HTTP ("basic Web") support:

 

See the FTP section above for general notes and requirements.

 

The HTTP syntax is:

 

http://[user:password@]server[:port]/filename

 

For example:

 

copy http://jpsoft.com/downloads/v28/tcmd.exe

 

TCC-RT supports HTTP compression when receiving data.

 

FTPS ("SSL FTP") support:

 

See the FTP section above for general notes and requirements.

 

The FTPS syntax is:

 

ftps://[user:password@]server[:port]/filename

 

For example:

 

copy ftps://bob:pass@ftp.myserver.com/tcmd/tcmd.exe

 

TCC-RT will detect if it is running detached or as a service before prompting for SSL authentication, and will provide an automatic Y (yes) input.

 

SFTP ("SSH FTP") support:

 

See the FTP section above for general notes and requirements.

 

The SFTP syntax is:

 

sftp://[user:password@]server[:port]/filename

 

For example:

 

copy sftp://bob:pass@ftp.myserver.com/tcmd/tcmd.exe

 

TCC-RT will detect if it is running detached or as a service before prompting for SSH authentication, and will provide an automatic Y (yes) input.

 

HTTPS ("SSL HTTP") support:

 

See the FTP section above for general syntax and requirements.

 

The HTTPS syntax is:

 

https://[user:password@]server/filename

 

For example:

 

copy https://jpsoft.com/downloads/v28/tcmd.exe

 

TCC-RT supports HTTP compression when receiving data.