Previous Page TOC Index Next Page



FTP (File Transfer Protocol)


The FTP program enables people to move files easily across the Internet. This document outlines how to do this on the Kenyon VAX computers. Other Internet tools, such as Netscape, described elsewhere in this workbook, provide an easy-to-use interface for FTP as well.


What is FTP?


FTP is a program designed to move files (especially large ones) from one place to another via the Internet. One can down- or up- load a file using various FTP commands.

This utility is perhaps the most difficult use of the Internet to understand. In addition to an address to or from which you wish to transfer files, a detailed understanding of the network, the operating system at the foreign site, and a number of FTP commands, you will almost always need the proper username and passwords.


How to Use FTP


To Start FTP

The simplest way to connect to a foreign host to transfer files is to type FTP at the $ prompt and specify a host:

$ FTP host.domain R

A connection will be made and you will be asked for your username. After you provide it, you may be asked for a password.

FTP can also be started without a hostname; at the $ prompt type:

$ FTP R

Once inside the utility, you can connect to a foreign host by providing the appropriate IP address or host name after the OPEN command, like this at the FTP> prompt:

FTP> OPEN nnn.nn.nn.n R

or

FTP> OPEN host.domain R

For instance, if you want to FTP to Kenyon's academic VAX (usually a pointless but possible proposition) you could type at the FTP prompt:

FTP> OPEN 138.28.1.2 R

or

FTP> OPEN KCVAX1.KENYON.EDU R

Should you fail to properly provide your username or password, you may try again by using the USER and PASS commands. For instance, after supplying an incorrect password you might see:

<Login incorrect.

The connection is still open, as reflected by the new prompt,

KCVAX1.KENYON.EDU>

At this prompt, to supply a different username, type:

KCVAX1.KENYON.EDU> USER R

If you have only typed your password incorrectly, you may use the PASS command.

Other Systems

When dealing with different computers, you may run into another operating system (a way of organizing information and commands). Knowing the directory structure of a new (or familiar) operating system is important for finding what you need.

"Anonymous"

Some Internet hosts will not require you to have an account but will instead ask you to specify the name of the service you wish to access, so that you might log in as "anonymous". When you log in with a username of anonymous, it is customary to type your internet address when asked for a password.

To Change Subdirectories

To change what directory you are accessing, use the change directory command, as below for a VMS system like Kenyon's, at the KCVAX1.KENYON.EDU> prompt:

KCVAX1.KENYON.EDU> CD [directory.subdir] R

or as follows for a UNIX system:

CD /directory/subdir R

Beware of Playing Around

Experimenting with these functions is a rather tedious process, and should not be done. Other systems may decide that you are a threat to security there and disconnect you.

To Download A File

Once you have located the file you wish to download, use the GET command:

GET filename.txt R

Various messages appear during the transfer process, and these can be understood (if you are interested) with a little effort.

To Upload A File

If, on the other hand, you wish to upload a file to the foreign host, make sure that you are in the proper directory, and type:

PUT filename.txt R

File Types: ASCII or Binary

The FTP program can transfer files in either binary or ASCII mode. If you are about to transfer a file labeled .TXT or one you know is in an ASCII format, type at the host.domain> prompt:

ASCII R

Other files will be of a binary type. For these, type:

BINARY R

Please be sure that you know what you are transferring and that it is of a reasonable size. Transferring large files is often time-consuming and you should be careful not to use more space than you have been allotted on the Kenyon computers.

To Close a FTP Connection

When you are ready to close a connection to a foreign host, at the FTP prompt, type:

CLOSE R

or

BYE R

You can now OPEN another connection.

To Stop Using FTP

When you are done with your FTP session, to leave the program type:

EXIT R

The EXIT command will CLOSE any open connections before exiting FTP.


FTP
Commands


The following commands are recognized by most, if not all, ftp clients and servers.

ASCII

Sets file transfer to ASCII mode for transferring only ASCII text files.

BINARY

Sets file transfer to BINARY mode for transferring binary files. Examples of binary files would be programs, graphics, WordPerfect documents, etc.

CD directory

Change working directory on the remote system to the named directory.

CD /PUB/MSDOS RChanges working directory to /PUB/MSDOS

CLOSE

Ends FTP session and returns to FTP command mode. You can OPEN another connection or QUIT.

DELETE filename

Deletes the named file on the remote system.

DELETE OLDFILE.TXT R R

DIR

Displays directory listing of files in current working directory on remote system.

HELP command (or ?)

Displays brief information about the named command.

HELP DIR R

Type ? alone will display a list of all available FTP commands but without any instructions on use.

LCD directory

Changes the default working directory on the LOCAL system.

LCD C:\FILES RChanges working directory to C:\FILES on local computer system.

LS

Equivalent to the DIR command but displays a short listing.

LS /PUB/MSDOS R

MGET file-list

Gets multiple files from remote system to local system. The list of files can be filenames each separated by a space or specified by using wildcard characters. The wildcard character, an asterisk (*), means any file and a question mark (?) means any character at this position.

MGET *.* RGets all files.

MGET *.TXT R Gets all files with extension TXT

MPUT file-list

Puts multiple files onto remote system from local system. The list of files can be filenames each separated by a space or specified using wildcard characters (see MGET).

OPEN hostname.domain

or

OPEN IP-address

Connects to named remote system.

A system's hostname.domain format is similar to

kcvax3.kenyon.edu

or

magnus.Acs.ohio-state.edu.

A system's IP address is similar to

OPEN KCVAX3.KENYON.EDU R

OPEN 138.28.2.6 R

PWD

Prints the current working directory on the remote system.

QUIT

Closes any remaining FTP connections and exits FTP.

SEND

See PUT.

RECEIVE

See GET.

USER

Causes remote system to prompt for username and password. This is helpful if you enter an incorrect username or password and need the FTP server to prompt you again for your username and password.


File Transfer Protocol
Exercises


Begin by making sure you are logged into your Kenyon VAX account.

At the $ prompt type FTP R . This will start the FTP client program. Your account on the VAX is considered the LOCAL system.

Exercise:

GOAL:FTP to WIRETAP.SPIES.COM and GET JAPAN.CON (Japanese Constitution)

STEP 1)

Type: FTP WIRETAP.SPIES.COM R

STEP 2)

Type: anonymous R

STEP 3)

Type: your-email-address R

STEP 4)

Type: CD Gov/World R

STEP 5)

Type: ASCII R

STEP 6)

Type: GET JAPAN.CON R

STEP 7)

Type: R

STEP 8)

Type: CLOSE R

STEP 9)

Type: QUIT R

STEP 10)

Type: MORE JAPAN.CON R


Previous Page TOC Index Next Page