Network Services

Tuesday, April 22, 2014

Downloading Files



Downloading Files
After you log in to the FTP server, you’ll navigate to the directory that contains the files you want. Thankfully, the FTP command-line interface is similar to the DOS command-line interface.
This is no surprise since DOS is based on UNIX and FTP is a UNIX utility. Table 4.3 lists and describes the common navigation commands for FTP. Remember that these are also case sensitive.

     After you navigate to the directory and find the file you want to download, you must set the parameters for the type of file. Files come in two types:


  • ASCII, which contains text
  • Binary, which is all other files
If you set ftp to the wrong type, the file you download will contain gibberish. When in doubt, set ftp to download files as binary files.

TABLE 4 . 3 Common FTP Navigation Commands

ftp>ascii
Type set to A

To set the file type to binary, type binary at the ftp command prompt. Ftp will respond by telling you that the file type has been set to I (binary):

ftp>binary
Type set to I

To download the file, you use the get command, like so:
ftp>get scrsav.exe
200 PORT command successful.
150 Opening BINARY mode data connection for 'scrsav.exe'
(567018 bytes).

The file will start downloading to your hard drive. Unfortunately, with its default settings, the ftp utility doesn’t give you any indication of the progress of the transfer. When the file has
downloaded, the ftp utility will display the following message and return you to the ftp command prompt:

226 Transfer complete.
567018 bytes received in 116.27 seconds (4.88 Kbytes/sec)

TIP:
You can download multiple files by using the mget command. Simply type mget, a space, and then a wildcard that specifies the files you want to get. For example, to download all the text files in a directory, type mget *.txt.

0 comments:

Post a Comment