![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
LAST UPDATE: MARCH, 10. 1997 | C H A P T E R 2.3 - HOW TO - USE FTP |
![]() ![]() ![]() How to use FTP |
![]() ![]() ![]() |
![]() |
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 ![]() | |
![]() |
What do I need ?
As with many other services you need a client and a ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
![]() |
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 ![]()
| |
![]() |
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: | |
![]() |
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
| |
![]() |
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 .
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 | |
![]() |
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
open 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->>>>>>>>>>>>>>>>>>>>>>>>>>>>> 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 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
Navigating directories
ftp> dir | |
![]() |
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 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
ftp> asc or switch transfer mode to binary for all other files by typing
ftp> bin 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 Now start your transfer:
ftp> get last100uploads 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 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 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 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.
| |
![]() |
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. |