LAST UPDATE: MARCH, 10. 1997 C H A P T E R     2.3   -   HOW TO - USE FTP 

  IIC
  
  How to use FTP
Next 
Previous 
Next 

FTP is short for File Transfer Protocol. Its main purpose is, as you can see from the name, to transfer files from and to a remote computer. FTP *clients are available for a wide range of operating systems. There are window based and command line based clients. I can't give you detailed instructions on how to use a window based client, because of the variety of them available. However I will try to point out the things all the window based clients have in common. But I will try to give you instructions on how to use a command line based client. You should read this section (regarding command line based clients) because it will be easier for you to understand how a window based client will work.
Chapter 1 What do I need ?

As with many other services you need a client and a *server. For FTP, there are command line clients and windows based clients available. We will introduce how to ftp using a command line interface here - but if you plan to use a window based client do not go away this information will also be valuable to you. If you don't have any client yet, here are some points that do have one:

 

If you are using Microsoft Windows 95 or Windows NT 4.0, then you already have a command line FTP client. Click on Start, then select Run. Type FTP and press Ok
If you only want to download files you can also use your *web browser as a client. Therefore select open and type ftp://address where address is replace with the address of the FTP server you want to connect to. Furthermore your Web Browser will automatically determine if the selected file should be transferred as binary or as ascii. To open a directory or download a file simply click on it.

Top

Chapter 2 Where can I connect ?

There are thousands of ftp servers available on the Internet and it would be way too much to list them here. Others have already done so far. However, the following list provides some interesting starting points for ftp and you can test your ftp knowledge there:

Top

Chapter 3 How do I work with FTP ?

Before we begin, here's some information on how the files are stored on an ftp server. If you already have experience with unix, then you can go on to the next chapter, but since most of our visitors are coming from DOS/Windows based environments, a little introduction will be useful.

The files on a FTP server is stored like you know it from your hard disk. There are directories, filenames and file extensions. The file structure on an ftp server often looks like the *unix file structure.


The unix file system is case sensitive and uses long filenames.
If you are using an operating system, that only supports short filenames (8.3 convention), then your client will truncate the filenames if necessary But don't worry, your client or operating system will truncate the filename if necessary. Here is a typical FTP server directory listing:

drwxr-xr-x 6 0 1 1024 Dec 29 00:02 .
drwxr-xr-x 6 0 1 1024 Dec 29 00:02 ..
-rw-r--r-- 1 0 0 165 Oct 18 23:33 .message
-rw-r--r-- 1 0 0 1045 Oct 18 22:54 BECOME_A_MIRROR
-r--r--r-- 1 0 0 2166 Oct 18 22:47 CDROMS.TXT
-rw-r--r-- 1 0 0 2159 Dec 29 00:02 MIRRORS.TXT
-rw-r--r-- 1 0 0 17942 Oct 18 22:56 README
-r--r--r-- 1 0 0 1070 Dec 12 14:03 SYSTEM.TXT
-rw-r--r-- 1 0 0 1021 Oct 18 22:33 WINSITE.TXT
dr-xr-xr-x 2 0 0 1024 Dec 20 17:30 bin
drwx--x--x 3 0 0 1024 Dec 31 22:07 msgs
dr-xr-xr-x 3 0 0 1024 Dec 27 08:29 pub
drwxr-xr-x 3 0 0 1024 Jul 11 23:20 usr

Have a look at the directories and filenames on the right side of the above list. There are several text files (extension .TXT). These files normally contain information about the FTP server and the files stored on it. There also might be a list of * mirror (MIRRORS.TXT).


A mirror file usually contains a list of alternative sites, that offer the same files. It's a good idea to download this file and check if there is a server in your vicinity. If so, then please use it, as this will reduce net traffic and the files will be transferred faster.
Now please have a look on the left side, at the cryptic dr-xr-xr-x entry in front of every file or directory. These are the access rights for users: d stands for directory, r for read, x for execute and w for write. I won't give a detailed description now, since this belongs to UNIX. The important thing you have to know is, that if there is a d set (first flag, left side), the entry is a directory. The next three flags are important for you as an anonymous user. It defines the access rights. If a r is set, then you have read access, if a w is set, then you have write access and if there is an x set (short for execute) then you can execute something.

Loggin on to a server
Start you command line client and type open <address> where <address> is to be replaced with the address of an ftp server. Here is an example:

open ftp.winsite.com
Connected to ftp.winsite.com.

If you are using a window-based client locate an open or connect button or menu. You then might see a welcome message. Such a message could look like this:

220->>>>>>>>>>>>>>>>>>>>>>>>>>>>>
220-<<< Login with username "anonymous"; <<<
220-<<< use email address as password <<<
220->>>>>>>>>>>>>>>>>>>>>>>>>>>>>
220-
220 winftp FTP server (Sun Nov 5 20:26:15 EST 1995) ready.

Now log in using either anonymous or FTP as the username:

Name (ftp.winsite.com:k3070e2): anonymous

Now type in you e-mail address as a password. Note that you won't see it as you type it:

331 Guest login ok, send your complete e-mail
331 address as password.
331 Password: <e-mail here>

We have just connected to an anonymous ftp server. Not all servers are offering this access, but many do. For all other servers you have to know a username and a password.


Some servers do not have an anonymous access. If your server does not accept anonymous then you might try guest or ftp. Also some servers require the password to be guest as well, but anonymous along with your e-mail address is the most commonly used combination.
If the FTP server is to busy, that is if there are too many people logged on, then you will get an error message after you typed the username, indicating, that there are too many people logged on at this time and maybe a list of alternative servers (mirror servers).

Once you have successfully logged on you might see a message again. This message might be short overview, where the files are stored and/or something like the following:

230- 230-Please read the file README
230- it was last modified on Wed Oct 18 22:56:10 1995
239- 75 days ago
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

Navigating directories
Once the ftp> prompt is visible you can change directories and/or download or upload files. Let's begin with a directory listing, right after we have logged in. To get a directory listing use the dir command (like in MSDOS). This will present the following list to you:

ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 37
drwxr-xr-x 6 0 1 1024 Dec 29 00:02 .
-wxr-xr-x 6 0 1 1024 Dec 29 00:02 ..
-rw-r--r-- 1 0 0 165 Oct 18 23:33 .message
-rw-r--r-- 1 0 0 1045 Oct 18 22:54 BECOME_A_MIRROR
-r--r--r-- 1 0 0 2166 Oct 18 22:47 CDROMS.TXT
-rw-r--r-- 1 0 0 2159 Dec 29 00:02 MIRRORS.TXT
-rw-r--r-- 1 0 0 17942 Oct 18 22:56 README
-r--r--r-- 1 0 0 1070 Dec 12 14:03 SYSTEM.TXT
-rw-r--r-- 1 0 0 1021 Oct 18 22:33 WINSITE.TXT
dr-xr-xr-x 2 0 0 1024 Dec 20 17:30 bin
drwx--x--x 3 0 0 1024 Dec 31 22:07 msgs
dr-xr-xr-x 3 0 0 1024 Dec 27 08:29 pub
drwxr-xr-x 3 0 0 1024 Jul 11 23:20 usr
226 Transfer complete.


You can also use wildcards, like "*" to see a listing of those file of interest to you. The command dir *.txt would list all files ending with txt in the current directory. Also note that a unix ftp server is case sensitive, which means that file.txt is not the same as File.TXT.
We now want to have a look into the pub directory. To change a directory, use the cd command in conjunction with the directory name. Be careful. Here is how to change the directory:

ftp> cd pub
250-** Welcome to the Windows archive at WinSite(tm)
250-**
250-** For more information about this server,
250-** go to the root directory,
250-** and get the README file.
250-**
250-** The Archive:
250-** ftp.winsite.com:/pub/pc/win3
250-** Windows 3.x and Win32s files
250-** ftp.winsite.com:/pub/pc/win95
250-** Windows 95 files
250-** ftp.winsite.com:/pub/pc/winnt
250-** Windows NT files
250-** ftp.winsite.com:/pub/pc/starter
250-** Basic compress/zip/zoo, etc files
250-**
250-
250-
250-Please read the file README
250- it was last modified on Wed Oct 18 23:30:54 1995
250- 75 days ago
250 CWD command successful.
ftp>

Once again, you might see a welcome message, when changing to this directory (like above). Now you can do a dir again to see the contents of that directory. To navigate one level higher, use cd ..

Transferring files
While you can download files from nearly every directory, there is a dedicated upload directory most of the time. This directory normally is named incoming or uploads. To transfer a file you need to set the proper transfer mode first. Switch transfer mode to ASCII for plain text files typing

ftp> asc
200 Type set to A.

or switch transfer mode to binary for all other files by typing

ftp> bin
200 Type set to I.

Now you can start your transfer by using the appropriate command. Use get <filename> to download a file or put <filename> to upload a file. <Filename> is to be replaced with the exact filename (again, case sensitive if you're using a UNIX command line). You can't use wildcards (*, etc.) when using the get or put command. If you intend to transfer a set of files or want to use wildcards, then you have to use the mget <filespec> and mput <filespec> commands (m is for multiple). <Filespec> can contain wildcards.

ftp> mget *.*

Normally, when transferring files, you won't get any progress indicator. You can enable a progress indicator by typing hash at the prompt. Typing hash once will turn the progress meter on, typing it again will turn it off. The progress meter is displayed as a # for each 1024 Bytes transferred.

ftp> hash
Hash mark printing on (1024 bytes/hash mark).

Now start your transfer:

ftp> get last100uploads
200 PORT command successful.
150 Opening ASCII mode data connection for
150 last100uploads (7366 bytes).
########
226 Transfer complete.
7467 bytes received in 1.5 seconds (4.8 Kbytes/s)

As you can see, you will get a message, displaying that a transfer using either ascii or binary mode has been started and how much bytes will be transferred. Below you will see the hash marks. For each 1024 bytes, one hash mark is added. After the file has successfully been transferred, you will get the transfer complete message and how many bytes were transferred per second. Note that this is an average value.

If you want to transfer multiple files at one, you can use the mget and mput commands to do so. Then you might be asked to confirm the transfer of each file. This can be turned on or off.

ftp> mget *.txt

As you can see you have to use wildcards like "*" to define which files should be transferred. If the interactive mode is turned on, then a confirmation has to be given for each file which is about to be transferred. Such a confirmation looks like this:

ftp> mget *.txt
Get "index.txt" ? (Y=Yes, N=No, A=Get all, C=Cancel)

In this case pressing A will transfer all files without further asking. If you want to turn on or off the interactive mode, type the following command:

ftp> prompt
Interactive Mode is now OFF

The prompt command will toggle the interactive mode, which means, that if it is currently enabled, then it will be disabled and vice versa.

After you have completed your transfers you might want to log off. This is done by typing quit or bye.

ftp> quit
221 Goodbye.

You will see a goodbye message and in some cases, depending on the server, you will se additional message like how long you have been logged on and how many bytes you have transferred.

Top

Chapter 4 Additional information

If you need help type help at the ftp> prompt. You will see a list of available commands. Then you can use help <command> to get detailed help on that command, where <command> is to be replaced with the command name.

When uploading files, be sure to always use the appropriate directories and don't upload files, that don't fit on the server (e.g. upload a unix file onto a server, that is specialized in windows software). And don't upload copyrighted software. It's illegal. The administrator will remove your upload and maybe ban you from this site and might even shut it down. It doesn't pay.


Top
© 1996 - 97 Christian Feichtner  
Redistribution without permission prohibited, Legal Notices  
Internet Services provided and sponsored by EUnet International