|
Technology
Info, Tips, FAQs FTP - File Transfer Protocol
Page Contents FTP an Introduction - Northern Webs FTP - File Transfer Protocol - Tutorial
FTP an Introduction source: Copyright © 1995-1999, Northern Webs
There are many different ways of uploading/downloading of files, but in this document we are going to review the single most popular method available on the Internet. Simply put, uploading is the process of moving a file from your computer to some remote computer. Downloading is the exact opposite, that is, moving a file from some remote computer to your computer. One of the oldest Internet methods for moving files from one computer to another is called FTP. FTP stands for File Transfer Protocol. The name "FTP" can represent both a file transfer program, and the underlying protocol used to send information. It's perfectly natural to hear a person say "I used FTP to send a program," or, "Just FTP the files I need." It's a generic catch-all phrase for both the program being used and for how the information is transmitted from one computer to another. Navigator/Explorer/I-Comm users know about FTP. A partial version of FTP is built right into their program, but using it as such is cumbersome and difficult. Unlike email and network newsgroups, there is no distinct interface for FTP within Navigator, Explorer or I-Comm browsers. One way of using FTP from within your browser is from a web page. Often you will find a link which says "Download Now!" or something similar. Clicking on that link will automatically tell the browser to take the next data being sent to your computer and save it as a file on your local harddrive. This is by no means complete FTP. For example the direction of the link is all one way. Your browser doesn't have an easy way of sending files, only receiving them. Obviously someone at the browser companies never anticipated your wanting to send a file. Maybe they felt you didn't have anything to contribute, but WE KNOW better don't we? Given the fact that the browsers do not have a decent capability to send files, what other options are open to us? Well we are in luck. There are several extremely powerful programs available on the Internet right now that can perform the task of FTP in both directions. All we need to do is go get one of these programs. I am providing you with a couple of sites from which you can download these programs and others. However before you rush off to download them, please read the following. Most of the programs available on the Internet are the result of many hours of hard labour by one or more individuals. These programs are usually called shareware, which means you can download a fully working copy of the program and if you like it enough to keep it, the authors would like you to pay for it. Most shareware programs are extremely inexpensive and worth the money the author is asking for. Show your appreciation for the author and his effort and preserve your honor by paying the requested amount to the author! Now for the list of locations from which you can download files. These locations include a lot more information and programs than just FTP programs (This is a more expanded list than the one given in chapter II).
FTP Basics If you have gotten a good FTP program you will have quite a lot of capability, most of which you will never use. There are six basic commands/functions common to all FTP programs which you will use, over and over again. These are;
root/-----/bin Above is a VERY simplified directory structure for a mythical FTP server. Items are placed in a directory structure where every directory, with the exception of the top level, can have a parent directory. It can also have multiple children directories (i.e. directories branching from it). If a file called stuff.txt is placed into directory /b, it's total address within the FTP server is /pub/b/stuff.txt (note that the root is not specifically called out, instead it's implied). Another major difference between MSDOS directories and UNIX directories is the abilities to have VERY long directory names. Move stuff.txt to /programs.obsolete and it's new location becomes /pub/c/programs.obsolete/stuff.txt
Getting a file from an FTP server. By now, you have downloaded an FTP program for your machine, and should have a basic understanding of the commands needed for sending and receiving files. Like the famous movie saying goes "Who ya gonna call?" Well, we didn't want to leave you completely hanging, so near the end of this document is a partial listing of FTP sites you can log into and download software from. Some sites are shareware/freeware archives (Like Simtel and Garbo, and Washington U). Others, like the Microsoft and Quarterdeck FTP servers provide you with updates, patches and device drivers for their line of products. FTP Addressing The address of an FTP server serves the same purpose as an email address or a web address. It uniquely identifies one particular location on the net. Like other addresses it can take several forms. For example;
FTP Connecting The first thing you need to do is locate the particular server on which the software you want resides. For the purposes of the rest of this tutorial, we will deal with a file which we have stored on our FTP server. Download it successfully and you'll have a nice graphic for you home page proclaiming to all the world that you successfully understood this tutorial!
230-Welcome, archive
user! This is The Cafe Connection FTP server.
250 CWD command
successful. drwxr-xr-x 2 0 0
1024 Apr 7 02:22 .
SimTel Archives
WinVN (Winsock News
Reader)
Sending a file via FTP. Sending a file via ftp is similar to getting a file. The only difference being the actions are reversed. Instead of GETting the file, you are PUTting the file. We do not need to cover the exact sequence because the two functions are so closely linked. However, we do need to say a few words about sending files from one computer to another.
FTP - File Transfer Protocol - Tutorial In this tutorial
you will learn how to install and configure an FTP server, install an
FTP client and use the FTP client to locate and download files. * Overview of FTP
FTP is an extremely useful facility which operates either on the Internet or on any TCP/IP network. It provides the ability to transfer electronic files from one host to another in either direction. It may be used to obtain copies of applications, manuals, academic and discussion papers or data files. FTP is a stable protocol which has not continued to evolve like HTTP. It uses the TCP protocol for the reliable transfer of files. The protocol allows the transfer of any file format, and provides a more efficient alternative to using HTTP or attachments in e-mail. A similar protocol TFTP (Trivial File Transfer Protocol) provides connectionless file transfer over UDP. This is only suitable for very small files; for example, uploading configuration files to routers. File Transfer Protocol (FTP) FTP was one of the earliest protocols used on the Internet. It was originally a text-orientated interface, using a series of Unix commands to control the process. Nowadays GUI interfaces have been developed to make the process simpler. It is especially useful for transferring files between computers using different operating systems or file systems. For example, transferring a file from a UNIX host to a host running Microsoft Windows 98.
The World Wide Web (WWW) has replaced many of the functions of FTP. However, until recently, the web was limited to downloading files. Only FTP allows you to upload; that is, to copy files from a client computer up to a server. If your remote users need to do this, they must use FTP. Also, if you have existing files that you want to make available to remote users, FTP is an extremely easy service to install and maintain. After installation, the FTP service is simply pointed to the location of the files; no additional configuration is necessary. Files made available through FTP can be in any format, such as document files, multimedia files, or application files. Using FTP allows access to information more quickly than sending disks and hardcopy materials through regular, or even express, mail. Typical applications for FTP include: * distribution of software, patches / updates or drivers * providing copies
of manuals or documentation for products. A variety of formats are used,
including MS Word (DOC), Adobe * major advantage is the ability of FTP clients to upload (as well as download) files to the FTP server, allowing mobile or remote members of staff to work on documents held centrally * FTP is often used
by web server administrators to manage the files which comprise their
web sites remotely
FTP is a client/server application for transferring files from one host to another. The FTP standard is defined in RFC 959 (October 1985) which superseded RFC765. The standard has been subsequently updated in RFC2228 and RFC2640. RFCs can be downloaded from www.internic.net. The RFCs describe the communication channels established between client and server, and the commands/ responses that the client can send and expect to receive. Two different types of communication channel are used by the FTP process: * Control - used
for commands and server responses on TCP port 21 The File Transfer process consists of the following stages: 1. Establish session
C:\>FTP 100.100.100.100
The FTP server listens to the control port defined for the application (21 by default). The client establishes the control connection using port 21 by typing ftp FQDN or ftp IP_Address at the command prompt. The server responds with a message prefixed by a number. The number indicates the type of message as defined in the RFC. For example, 220 means service ready for new user. The client listens on a specified data port, which is allocated as the application is launched. FTP commands are control codes followed by parameters (not case sensitive) which are used to control the FTP session. An FTP session follows an alternating dialog between client and server.
The FTP server prompts for a username and responds with message 331, which indicates that the username is recognized and a password is required. If the password supplied is correct, the FTP server authenticates the user and responds with a message: 230 - User login OK. If the server does not prompt for a username and password, the USER and PASS commands may be used to specify username and password respectively. In the example above, the server states that it is currently using Binary mode to transfer files.
The FTP prompt is displayed by the client to indicate that the session control commands can now be used. These commands can
be separated into three distinct categories:
* -? - use -? by
itself to display a list of commands or add the -? switch to any command
to obtain help on the syntax and use The pub directory (short for public) is usually for files which are available to the public. FTP commands support the use of wild card characters * and ?
FTP supports two types of transfer mode, and the commands ASCII and BINARY may be used to switch between them: * ASCII this command provides ASCII or text mode - this is a 7-bit mode and allows the transfer of text files only. The use of ASCII transfer for a non-text file results in a corrupt file being transferred. * BINARY this command ensures the use of binary or image mode - this mode is 8 bit and allows the transfer of binary files (for example, any file format other than ASCII text). Some FTP systems use the abbreviations I for Image (Binary) and A for ASCII.
* verbose this command may be used to toggle on/off the display of all messages received from the FTP server. By default verbose mode is on. * system the system command may be used to display the o/system of the FTP server
* close command closes the current session but leave the FTP client running * open command may be used to open a session with another FTP server * quit command closes the control connection with the FTP server and exits from the FTP client application Many more command are available for FTP sessions. These can be found either in the RFC, or by typing ? or help at the FTP prompt.
FTP clients may take a number of forms: * All the original FTP clients were text-based, and required a user to understand the FTP command syntax for successful file transfers to be completed. Most network operating systems include a command line client interface (as shown in the examples above) with the TCP/IP installation files. * Command-line utilities are difficult for users to learn. Therefore, graphical FTP clients were developed to provide more intuitive methods of connecting to servers, browsing directories and uploading or downloading files. An extremely popular FTP utility of this type is WS_FTP produced by IP Switch Software. * Another popular method for accessing FTP servers is to use an Internet browser. The browsers offer a limited service which typically only allows a user to connect to an FTP server as a guest (anonymous) user and to download files. The user must supply the browser with the URL of the FTP server; e.g. ftp://ftp.hp.com/
You can navigate the directory structure by automatically listing the directories and files as hypertext links. You can open the content of the directory by clicking on a directory hyperlink, and you can download or open the file by clicking on a file hyperlink. You cannot typically upload files from a client to a server using browser software. The URL used to connect to the FTP site can also include a user name and password if authentication is required. The syntax is as follows: ftp://username:password@site_address
Little configuration is available for the command-line and browser clients. The GUI-based clients do offer some configurable facilities, including the following: * Home directory - the directory into which a user connecting to the machine is initially placed. This location can be set on a per-user basis * Local directory for the FTP client * Profiles for particular server connections. These include: - authenticated connection with a username and password or anonymous access - server type - IP address or FQDN for the server Downloading files from the Internet carries a significant risk of virus infection. It is strongly recommended that all machines used for FTP are protected with the most up-to-date virus software.
Most FTP server packages allow you to configure a number of parameters. For example: * The number of simultaneous connections allowed (this is also known as throttling). FTP servers are generally configured for a lower number of connections than a web server, since the average FTP session is longer and also transfers much more data. This value should be reduced if the FTP client requests are placing an excessive load on the server. * The TCP port on
which the FTP server listens for client connection requests. By default,
this is port 21; however, using a different port makes the server more
secure. * Three different messages which can be configured for an FTP server: - the welcome message - displayed when the user first connects. - the exit message - displayed when the user disconnects. - the maximum connection message - displayed when the maximum simultaneous connections parameter has been reached. FTP directories may be configured to support Read and / or Write access. Read permission allows users to list files and copy them from the server to the client. Write permissions allow users to upload files to the server. It is recommended practice to provide a dedicated directory for uploading files to ensure that users are not able to inadvertently overwrite files with the same name. FTP servers support logging. The level of detail may be configured for security and audit purposes.
FTP servers typically provide two types of access, authenticated and anonymous. Authenticated Access with Username and Password The FTP server authenticates the user, by ensuring that a valid username and password combination are supplied before allowing access to the FTP server resources. As with other file servers, the username and groups to which a user belongs can determine the resources which are accessible, and the level of access which is available to each. Resource permissions can be set on a directory or file level. Anonymous Access FTP servers normally provide the facility to log on as a guest and obtain access to the files deemed to be available to public. The user logs onto the server using the anonymous username and any password which follows the format of an Internet e-mail address; for example, fred@isp.net Some systems also allow you to prevent anything BUT anonymous use. This is useful for security because only one account, (that assigned for anonymous logon), is permitted access. Intruders cannot attempt to gain access with the administrator account or have their passwords read as they log in. Normally a user who anonymously accesses an FTP server is mapped to a default user account (for example, IUSR_<computer_name> for IIS). This account may be renamed or changed as required. Directories and files on the server include or exclude this account (and any groups to which it belongs), to provide appropriate access permissions. Searching for a File There are probably millions of files available via FTP on the Internet. The search tool Archie can be used to locate a file by searching FTP sites. You enter likely keywords for the file name and Archie searches its database for matches. Archie then sends you a list with full file names, and the address information you need to retrieve the file via FTP.
back to Technology Content Index
Events
Calendar What's
New
|