FTP Clients in HTML - HTML

The first FTP clients were text-only applications. The connection is initiated and data is transferred using textual commands. The latest FTP clients employ the same graphical interface as most modern operating systems, using standard file manager-like interfaces to accomplish FTP operations.

Note:Graphical FTP clients use the same methods and commands to communicate with the FTP server, but typically hide the communication from the user. The following listing shows a typical dialog using a textual FTP client. The client initiates a connection, and the user logs in, gets a directory listing on the server, and then transfers a file. For clarity, the commands entered by the user are in boldface:

$ ftp ftp.example.com
Connected to ftp.example.com.
220 ftp.example.com FTP server ready.
Name: sschafer
331 Password required for sschafer.
Password: ——————
230 User sschafer logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd www
250 CWD command successful.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
drwxr-xr-x 2 sschafer sschafer 4096 Jan 20 16:45 Products
drwxr-xr-x 2 sschafer sschafer 4096 Jan 16 18:41 About
drwxr-xr-x 2 sschafer sschafer 4096 Jan 6 15:16 Images
-rwxr-xr-x 1 sschafer sschafer 1571 Jan 12 17:58 index.html
drwxr-xr-x 2 sschafer sschafer 4096 Jan 15 04:16 Scripts
226-Transfer complete.
226 Quotas off
ftp> put index.html
local: index.html remote: index.html
200 PORT command successful.
150 Opening BINARY mode data connection for index.html.
226 Transfer complete.
2095 bytes sent in 0.3 secs (3.6 kB/s)
ftp> close
221 Goodbye.
ftp> quit
$

Figure shows a graphical FTP client accessing the same site. The client shows the file listing of the remote server. To transfer a file, the user simply drags the file into or out of the client window. Notice the underlying FTP commands and output in the lower-right corner of the application. Some graphical clients allow you to take manual control, entering spurious commands as required.

ASCII versus Binary Transfers
FTP servers support two modes of file transfers: binary and ASCII. Binary mode transfers are used when the content of the file contains higher-byte characters—characters not generally available on the keyboard. ASCII transfers are used when the content contains only lowerbyte characters, such as text files. Some FTP servers will automatically switch file modes as required, but most FTP servers require that the mode be explicitly changed. Some FTP clients will also automatically change the mode depending on the file being transferred. As a general rule, always double-check the mode being used before transferring files.

Most files can be transferred in binary mode. However, some ASCII files don’t respond well to being transferred in binary format. For example, Perl scripts transferred in binary format will generally have their line breaks corrupted, creating problems for the Perl interpreter when the script is run. You might consider enabling ASCII mode when transferring text files, just in case.

Graphical FTP clients use graphical user interface methods to transfer files.

Graphical FTP clients use graphical user interface methods to transfer files.

Notable FTP Clients
Most operating systems include a textual FTP client, aptly named FTP. To use the client, type ftp at a command prompt. However, not all textual clients use the same commands or have the same options. Most clients support a help command—type help followed by the name of the command you need help with. Unfortunately, the standard help output simply tells you what the command does, not the syntax or options.

Tip:There are many ways to place files on the Web server. The easiest, of course, is to create and edit the files directly on the server. If you are using a development product (such as those discussed in Chapter 34), you can use its features to upload your content (typically such programs use FTP to transfer files).

Common ftp commands

Quite a few graphical FTP clients are available—from $100 commercial solutions to shareware solutions. The following list is a subset of available clients:

Windows clients

  • FTP Voyager—This shareware client allows you to transfer files between servers, resume aborted downloads, and more. It also has a scheduler that can automatically transfer files as set times.
  • CoffeeCup FTP client—This freeware client contains the usual options for graphical clients.
  • CuteFTP—This popular Shareware client contains a number of features to make FTP transfers easier. It provides a download queue, macro recording, and a scheduler to automate file transfers.
  • WS-FTP—This FTP client has the typical features found in other commercial solutions, but is free for certain individuals and organizations.
  • Internet Neighborhood Pro—This commercial client from KnoWare, Inc. allows an FTP connection to function as a network drive mapping.

Linux

  • Desktop specific clients—Both K Desktop Environment (KDE) and Gnome include graphical clients specific to the desktop environment.
  • Additional Open Source solutions—Many graphical FTP clients are available for Linux. Each distribution contains several you can choose from. Even more are available from various online sources.

Tip:Your Web browser can be used as a graphical client. Simply specify the FTP protocol (ftp:) and the server address.

If the server requires authentication, you will be prompted for your login information. If you want to create a shortcut to a site with authentication, you can embed the login information into the URL.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

HTML Topics