- Back to Home »
- FTP Protocol
Posted by : Unknown
Monday, July 1, 2013
HIGH-SPEED FILE EXCHANGE
Introduction:
Lick an
ice cream, munch on some wafers, dig into some chocolate and at the same time
upgrade your computer software from the comfort of your chair. Who said dreams
don’t come true? The Net has made our lives so much easier that getting hold of
the day’s stocks or even the complete works of Shakespeare is not a big deal.
Just connect and download the information you want.
It’s as simple as data, which has to be transferred from one
computer to another over a network. This is where FTP steps in. In its simplest
form, FTP allows the sending and receiving of files between computers. FTP, or
File Transfer Protocol, at the crudest level is a standard using which you can
upload or download files on the Internet.
The term protocol suggests
standardization. It is a set of rules defining a format. To say it in a
slightly different way, a network protocol describes how computer systems
communicate with each other at a unit level. This is what allows you to
exchange files globally. To make it clearer, let’s say you have a friend and
you want to ask her to come over for dinner. How do you do that? You call her
up and tell her to come over for dinner! This very simple process involves the
use of speech over language. Language is the protocol here, which you and your
friend understand. What if your friend were Hungarian? You would have to
probably look up a dictionary and formulate the appropriate sentences so that
she understands that you are calling her for dinner, not asking her out
ice-skating! Since the Internet understands a definite language for
transferring file, it makes it easier for you to exchange information with
others.
HTTP (Hyper Text Transfer Protocol) is the protocol used by Web
browsers to communicate with Web servers. A Web browser is an Internet client
application and the Web server is an Internet server application.
HTTP has the ability to transfer Web pages, graphics, and any other
type of media that is used on the Web. The client (browser) makes a request to
the server, which serves the files (Web pages) to it. Similarly, FTP follows
the same architecture – and FTP client connects to an FTP server and downloads
or uploads file to or from it.
Technically, FTP can be used as part of any application on the
Internet, since it is a basic file transfer method. However, in some cases it
may be too limited or inappropriate. However, a few key uses of FTP can be
outlined. It can be used to share files such as software or data. It can also
be used for indirect or implicit use of remote computers (via programs). If a
remote control displays the remote screen on the local machine, it is
essentially transferring image files. This can easily be handled by FTP and the
program can then process the images. It can also be used to standardize file
transfer methods over an intranet or extranet. This means that you can use
FTP’s inherent security measures and not bother with having to set up another
security system for file sharing.
Why FTP?
Whether we use FTP or any other method, it is transfer of data over
a large network that we need to achieve. With the evolution of the Internet,
other standards of file transfer have been developed too. In fact, many of
these were designed to be user-friendlier than FTP and are widely used today.
As we have already seen, HTTP does pretty much the same thing as
FTP. A browser requests a file and the Web server sends it to the browser. This
can work the other way too, with the browser uploading a file to the Web
server. Most users use e-mail as a means of transferring files. It is extremely
simple to attach files to a message and send it to a recipient who simply has
to check his or her e-mail to download the file. So why not use any of these or
other methods of uploading or downloading files?
With FTP, you can queue files for upload or download, whereas you
cannot do so over HTTP. File transfers over FTP can always be resumed. The
server would specifically need to support this capability in case of HTTP.
Also, security over FTP is much more manageable than HTTP. With FTP, security
restrictions can cascade down folders with specific rights on all of them, much
as on a file server over a LAN. Uploading files over FTP, too, is much easier
than over HTTP.
E-mail attachments (using Simple Mail Transfer Protocol or SMTP)
have lots of drawbacks. The e-mail service has the least priority on the server
if it runs multiple services, such as Web services, FTP services, etc., which
means it is the slowest means of transfer. Most e-mail service providers
allocate restricted amounts of space to each user and sending huge files would
mean clogging up someone’s account – often the files may even bounce back! For
the recipient, most e-mail sites do not support resuming, which means that if
the connection breaks, he would have to download it all over again. Also,
different e-mail clients or providers may encode attachments in different ways,
for each of which the recipient would require a decoding mechanism. Most
importantly, e-mail attachments take up exactly double the amount of space that
a file would otherwise. This is because e-mail can be sent only as text over
the Internet. Most users and providers have standardized on MIME (Multipurpose
Internet Mail Extensions) as the encoding format for attachments. Here, every
byte in the file is represented by two ASCII (text) characters. This doubles
the size of the file.
The FTP Server:
An FTP server is like a large filing cabinet. With a traditional
filing cabinet, the person who does the filing has the option to label and
organize the files. They also decide which files to keep locked and which
remain public. It is the same with an FTP site. To use an analogy, if you
wanted to pass a book to another person you put the book in his hands.
Conversely, if you want to take it back, you get the book from his
hands. In this case, if he does not allow you to take the book, you cannot.
This is the same principle behind FTP. The FTP server is a computer waiting for
someone to put a file onto it or get a file from it.
The FTP server maintains the files on it, the users who can access
them, the amount of control each user has over the files and the number of
people who can log on simultaneously to it. A person can have any combination
of read, write and delete options over each file or folder. This means that a
person can either read or retrieve a file, change or upload a file or delete an
existing file. Most FTP servers maintain an anonymous login by which anyone can
access to publicly available files on the server without having to provide a
password. In an anonymous FTP session, the user provides the generic username
‘anonymous’. As a password, you would typically use your e-mail address.
Anonymous users usually have very limited access privileges. For example, they
may only have access to one or two directories and may be able to copy but not
delete files. Other users are assigned a custom username and password so they
can access private directories.
The FTP Client:
To make a connection to an FTP server, you have to use an FTP client
– software that can communicate with the server using the FTP protocol. Most
Web browsers now incorporate FTP into the browser itself. Hence, you can use
Internet Explorer or Netscape as your FTP client. However, it is easier to use
dedicated FTP software. Even the older DOS and Unix systems have FTP clients
with them. Dedicated FTP clients allow you more control over your FTP session,
as you are able to carry out every action that is possible on the server. This
is because they are command based. Browsers, on the contrary, do not allow you
to do much more than downloading or uploading files. The most immediate
advantage of an FTP client you will notice is the Resume feature. It can start
transfers of broken downloads from the point where it disconnected so that you
do not have to download the entire file again.
Let’s take a look at some popular FTP clients.
BulletProof FTP:
Bulletproof FTP (BPFTP) delivers a wide range of traditional FTP
features as well as several unique ones. Its best feature is its ability to
reconnect automatically and resume terminated file transfers. Another useful
feature is the Leech mode option, which is not available in any of its
competitors. Some FTP servers restrict the number of downloads in one session –
BPFTP will automatically disconnect when you reach the maximum number of
downloads, reconnect and resume downloading again. It also has
clipboard-monitoring support for both, FTP and HTTP links.
Additional features of BPFTP include firewall and proxy support,
remote mirroring capabilities, HTTP downloading with support for redirected
URLs, capability to periodically send a random command to prevent the server
from disconnecting and recursive uploading and downloading of directories. It
can also import all site listings and passwords from CuteFTP, FTP Explorer and
WS-FTP. It caches remote file listings, allowing faster browsing. It also has
basic scheduling capabilities and the ability to queue multiple file transfers.
BPFTP works a bit differently compared to most FTP clients. After
selecting a file operation, BPFTP first enters the commands in a queue. When
ready, you just have to click once and BPFTP takes you through each of the
tasks. Such batch transfer jobs can be carried out in different directories and
even on different sites.
CuteFTP:
One of the oldest FTP clients to become popular, CuteFTP is packed
with plenty of features and configuration options. It works on any Windows
platform. Ever since its arrival in the market, two features that stand out are
the Stop command, which allows you to stop any operation in progress while the
connection is still maintained and the Keep alive command that helps in
transfer of data without interruptions.
Apart from this, CuteFTP blends the file listing process with file
descriptions obtained from index files found at many anonymous FTP sites. One
normally faces cryptic file names on FTP sites and this feature is helpful in
deciphering them. CuteFTP also caches recently visited directories, making browsing
through them faster.
Other features include comprehensive login listings, customizable
colours, the ability to download and upload complete directory trees and the
ability to sent multiple files at a time. Recent updates have a sleek new
design and improved drag-and-droop functionality, automatic resuming for
interrupted transfers, directory comparison capabilities, a file transfer
queue, support for macro scripting, remote file editing custom commands,
automatic renaming and a quick-save command for remote and local default
directories.
Also included is an MP3 and file search feature, an integrated
CuteHTML Lite client, site-to-site file transfer capabilities, URL parsing,
clipboard monitoring, an improved site manager and scheduling.
FTP Voyager:
This is a pretty good FTP client that sports an interface similar to
that of Windows Explorer. It also incorporates useful features from Explorer
such as multiple file listing display, quick sorting, content menus and
drag-and-drop capabilities. Apart from this, Voyager offers many critical file
transfer features o fits own. These include Folder shortcuts, file filtering
capabilities, an instant Stop feature and quick searching capabilities. You can
easily crate special folders that can be accessed from the root even when the
link could be a directory that’s much deeper.
Voyager offers buttons that can connect to specific FTP sites
automatically, launch Windows Explorer for quick file transfers between two
clients or automatically sending a group of files upon connection. Folder
synchronization tools provide a simple solution for backups or Web site
maintenance. Another very useful feature is the capability to edit remote
files.
Additional new features include firewall and proxy support, an
online help system, retry and resume support, automatic rename capabilities,
extensive configuration options, an impressive site manager, and an improved
list of common FTP sites. The latest versions also include a scheduler that
allows scheduled file and folder uploads, a transfer queue that performs file
uploads and downloads sequentially, as well as clipboard monitoring support.
WS-FTP:
WS-FTP is an award-winning FTP client from RhinoSoft.com. It is a
simple program with an Internet Explorer-like interface. Its features include
several alternative screen layouts, the ability to associate remote files with
local programs, automatic logging, extension conversion on transfer, force
lower case on transfer and quick screen sizing. WS-FTP also comes pre-configured
with an extensive array of FTP sites to check out. Multiple copies of the
program can be launched to download multiple files.
WS-FTP Limited Edition (WS-FTP LE) is a restricted freeware version
of WS-FTP. This release lacks several features in Pro version. The Windows
Explorer FTP shell extension support, which allows you to connect to FTP sites
and upload or download files using Windows Explorer, is one of the features
that’s missing. WS-FTP Professional Edition (WS-FTP Pro) costs, but has useful
additional features. These include automatic resume capability for file
transfers, a network utilities package (ping, trace route, finger, whois and
nslookup clients), support for multiple file transfers, scheduling and file
transfer queuing. You can even run scripts developed with the scripting utility
at set intervals. Support for SSL (Secure Sockets Layer) encryption protects
your valuable information when you connect to an SSL FTP server. It also has
enhanced firewall support that allows quicker connections by storing multiple
firewall settings.
File Transfer:
Files can be transferred in either ASCII or binary modes. Text files
(rather, text-based files) should be transferred in ASCII mode, since this
ensures that the document is translated into a format that is suitable for
reading on your computer. Keep in mind that this translation is only useful for
text-based files and it usually makes other files unusable.
Binary files, such as executable programs and compressed archives,
require Binary mode transfer. This mode transfers an exact copy of the original
file. FTP does not translate any data from the file. It simply reads the bytes
from one computer and writes them out in the same sequence on the other.
Once you have navigated the remote host’s directories and found the
file(s) that you wish to retrieve, it is necessary to determine the file type.
By default, FTP uses ASCII mode to transfer files. Most files can be
reliability transferred using the binary mode. However, text documents,
postscript documents and Uuencoded files are some of the text-based files that
should be transferred using the ASCII mode. This is because FTP copies the data
across, not the bytes, hence making the file compatible across platforms.
FTP Commands:
With the number of FTP clients available, you will never need to
know any FTP commands. Also, if you are only bothered about uploading and
downloading your files, you can use just your browser -- either of these would
take care of the file formats and transfer modes, too. However, it is always
better to know the FTP commands, just so that you know what you can and cannot
do during an FTP session.
When an FTP server is waiting for user actions, the prompt ftp>
is provided where you can type commands. Commands are always entered in upper
case, though most servers now accept either upper or lower case commands. The
following list of commands is applicable across all FTP servers. Servers on
different platforms may have extended features, too. These can be taken
advantage of by using the REMOTEHELP command.
Command |
Syntax |
Result |
!
|
! [command
[args]]
|
Switch to the
command prompt at the local machine while keeping the FTP session alive. If
there are arguments, the first is taken to be a command to execute directly,
with the rest of the arguments as its arguments.
|
?
|
? [command]
|
Print help
about a command. If no argument is given, FTP prints a list of known
commands.
|
APPEND
|
APPEND
local-file
[remote-file]
|
Append
local-file to a file on the server. If remote-file is unspecified, the local
file name is used for the remote file.
|
ASCII
|
ASCII
|
Set the file
transfer type to ASCII. This is the default type.
|
BELL
|
BELL
|
Toggle
settings for a beep after each file transfer is completed.
|
BYE
|
BYE
|
Set the file
transfer type to binary.
|
CD
|
CD
remote-directory
|
Change the
working directory on the server to remote-directory.
|
CLOSE
|
CLOSE
|
|
Command |
Syntax |
Result |
DELETE
|
DELETE
remote-file
|
Delete
remote-file on the server.
|
DIR
|
DIR
[remote-directory]
[local-file]
|
Print a
listing of the directory contents in remote-directory and, optionally,
placing the output in local-file. If no remote-directory is specified, the
current working directory on the server is used.
|
DISCONNECT
|
DISCONNECT
|
Terminate the
FTP session with the server and return to the FTP command interpreter.
|
GET
|
GET
remote-file [local-file]
|
Retrieve
remote-file and store it on the local machine. If the local filename is not
specified, the filename on the server is used.
|
GLOB
|
GLOB
|
Toggle
filename expansion for MADELTE, MGET and MPUT. If globbing is turned off, the
filename arguments are taken literally and not expanded.
|
HASH
|
HASH
|
Toggle
printing of the hash (#) symbol for each data block transferred. The size of
a data block is 1024 bytes.
|
HELP
|
HELP [command]
|
Print help
about a command. If no argument is given, FTP prints a list of known
commands.
|
LCD
|
LCD
[directory]
|
Change the
working directory on the local machine. If directory is not specified, the
user’s home directory is used.
|
LS
|
LS
[remote-directory]
[local-file]
|
Print a listing
of the directory contents in remote-directory and, optionally, placing the
output in local-file. If no remote-directory is specified, the current
working directory on the server is used. The listing includes nay
system-dependent information that the server chooses to include.
|
MDELETE
|
MDELETE
[remote-files]
|
Delete
remote-files on the server. Can be used with wildcards to delete e multiple
files if GLOB is off.
|
MDIR
|
MDIR
remote-files local-file
|
Like DIR,
except multiple remote directories may be specified.
|
Command |
Syntax |
Result |
MGET
|
MGET
remote-files
|
Retrieve
remote-file and store it on the local machine. Can be used with wildcards to
retrieve multiple files if GLOB is off.
|
MKDIR
|
MKDIR
directory-name
|
Make a
directory on the server.
|
MLS
|
MLS remote-files
local-file
|
Like LIST,
except multiple remote directories may be specified.
|
MPUT
|
MPUT
local-files
|
Store a local
file on the server. If remote-file is unspecified, the local file name is
used. Can be used with wildcards to store multiple files if GLOB is off.
|
OPEN
|
OPEN
host [port]
|
Establish a
connection to host. If port is specified, FTP will attempt to contact an FTP
server at that port.
|
PASS
|
PASS password
|
Sends a user’s
password to the server.
|
PROMPT
|
PROMPT
|
Toggle
interactive prompting. Interactive prompting occurs during multiple file
transfers to allow the user to selectively retrieve or store files. If
prompting is turned off (default is on), mget or mput will transfer all
files, and mdelete will delete all files.
|
PUT
|
PUT
local-file
[remote-file]
|
Store a local
file on the server. If remote-file is unspecified, the local file name is
used.
|
PWD
|
PWD
|
Print the name
of the current working directory on the server.
|
QUIT
|
QUIT
|
Terminate the
FTP session and exit FTP.
|
QUOTE
|
QUOTE
arg1 arg2 …
|
The arguments
are sent as a server command directly to the FTP server on the remote system.
|
RECV
|
RECV
remote-file
[local-file]
|
Retrieve
remote-file and store it on the local machine. If the local file name is not
specified, the filename on the server is used.
|
REMOTEHELP
|
REMOTEHELP
[command-name]
|
Request help
from the remote FTP server. If command-name is specified, help on that
command is printed.
|
Command |
Syntax |
Result |
RENAME
|
RENAME
original-name new-name
|
Rename the
file original-name on the server, to the file new-name.
|
RMDIR
|
RMDIR
directory-name
|
Delete a
directory on the server.
|
SEND
|
SEND
local-file [remote-file]
|
Store a local
file on the server. If remote-file is unspecified, the local file name is
used.
|
STATUS
|
STATUS
|
Show the
current status of FTP.
|
TRACE
|
TRACE
|
Toggle packet
tracing.
|
TYPE
|
TYPE
[type-name]
|
Set the file
transfer type to type-name. If no type is specified, the current type is
printed.
|
USER
|
USER
user-name
password
|
Identify
yourself to the remote FTP server. If password is not specified and the
server requires it, FTP will prompt you for it.
|
VERBOSE
|
VERBOSE
|
Toggle verbose
mode. In verbose mode, all responses from the FTP server are displayed to the
user. In addition, if verbose is on, when a file transfer completes,
statistics of the transfer are reported. By default, verbose is on.
|
Conclusion:
Probably one of the oldest protocols on the Internet to still remain
alive, FTP, or File Transfer Protocol, is the most efficient means of
transferring files over the Internet. FTP is the Internet standard for file
transfer. Unlike most other TCP applications, it uses two TCP connections
between the client and server – a control connection that is left up for the
duration of the client-server session, and a data connection that is created
and deleted as necessary. The file
transfer provided by FTP copies a complete file from one system to another
system. To use FTP we need an account to login to on the server, or we need to
use it with a server that allows anonymous FTP.