Site hosted by Angelfire.com: Build your free website today!
Chapter 26: Other Internet Programs that Come with Windows XP

PreviousChapterContentsGlossaryNext

Transferring Files Using Ftp

Another way to transfer files to or from an FTP server is by using a separate FTP client program. Windows XP comes with a basic command-driven FTP client program called Ftp. If you plan to do much file transfer, especially uploading, you'll want to use Web Folders (as described in the section "Working with FTP and Web Servers Using Web Folders" earlier in this chapter) or a better FTP client program, such as WS_FTP.

Basics of FTP

To run the Windows XP FTP program, choose Start | Run. Type ftp serverhost, where serverhost is the host name of the FTP server, and click OK. If you are not connected to the Internet and you see your dial-up connection window, click Connect. You see the Ftp window, as shown in Figure 26-7.
[figure]
Figure 26-7: The Ftp window

To connect to an FTP server, you specify the host name of the server (for example, rtfm.mit.edu), and then you log in. You have two choices:

note UNIX, the operating system of choice among Internet servers, is sensitive to the case of the names of files, unlike Windows. Be aware of capitalization in file names.

Once you are connected to an FTP server, it displays lots of messages to let you know what's going on. These messages start with three-digit numbers, which you can ignore. For example, when you have transferred a file, you see the message "226 Transfer Complete."

When you transfer a file--by either uploading or downloading--you must choose between two modes:

tip At the Ftp prompt, type ? to see a listing of the commands that Ftp can perform.

Navigating the Folder Trees

The following are the most common ftp tasks:

[figure]
Figure 26-8: A directory list from an FTP server

On many publicly accessible FTP servers, all the downloadable files are in a directory called pub. Here are a few tips for moving to the directory you want:

tip If you want to disconnect from the FTP server and connect to a different server, you don't have to exit the Ftp program. Instead, type close or disconnect and press ENTER to disconnect from the FTP server. Next, type open, followed by a space, and then the host name of another FTP server; and press ENTER to connect to the other server.

Uploading Files

You use the put command to upload the files. To upload a group of files, you can use the mput command.

note You can upload files only if you have write permission in the directory on the FTP server. Most anonymous FTP servers don't accept uploads, or they accept them into only one specific directory. Read the welcome message to find out the rules for the FTP server you are using.

To upload a file, follow these steps:

  1. Connect to the FTP server, move to the directory on the FTP server in which you want to store the file, and set the current local directory to the folder on your computer that contains the files you want to upload.
  2. If the file or files you want to upload contain anything but unformatted ASCII text, type binary to select Binary mode. To switch back to ASCII mode to transfer text files, type ascii.
  3. Type put, a space, the filename on your computer, a space, and the filename to use on the FTP server. Then press ENTER. For example, to upload a file named draft13.doc and call the uploaded version report.doc, you would type put draft13.doc report.doc.
  4. You see a series of messages; the message Transfer Complete appears when the file transfer is done.

caution If a file with the name that you specify already exists on the FTP server, the put command may overwrite the existing file with the uploaded file. You can use the dir or ls command to check for the existence of a file with the same name.

  1. If you want to check that the file is really on the FTP server, type dir to see a listing of files in the current directory.

You can copy a group of files to the FTP server by typing mput (multiple put). Type mput, followed by a wildcard pattern that matches the names of the files you want to upload. The pattern * indicates that all files in the current directory on your computer should be copied. For example, to upload all the files with the extension .html, you would type mput *.html.

As it copies the files, mput asks you about each file. Type y to upload the file or n to skip it.

tip If you don't want mput to ask you about each file before uploading it, type the prompt command first before giving the mput command. The prompt command turns off filename prompting.

Downloading Files

To download files from the FTP server to your computer, follow these steps:

  1. Connect to the FTP server, move to the directory on the FTP server that contains the file that you want to download, and set the current local directory to the folder on your computer in which you want to store the files you download.
  2. If the file or files you want to download contain anything but unformatted ASCII text, type binary to select Binary mode. To switch back to ASCII mode to transfer text files, type ascii.
  3. Type get, a space, the filename on the FTP server, a space, the filename to use on your computer. Then press ENTER. (You can't use filenames with spaces.) For example, to download a file named bud9812.doc and call the downloaded version budget.dec1998.doc, the command is get bud9812.doc budget.dec2001.doc.
  4. You see a series of messages; the message Transfer Complete appears when the file transfer is done. To interrupt the file transfer, press CTRL-C. Sometimes that doesn't work, and the only way to interrupt the transfer is to close the FTP window.
  5. If you want to check whether the file is really downloaded, use Windows Explorer to see a listing of files on your computer.

You can copy a group of files to the FTP server by typing mget, followed by a wildcard pattern that matches the names of the files that you want to download. The pattern * means that all files in the current directory on your computer should be copied. For example, to download all the files whose names start with d, you would type mget d*.

As it copies the files, mget asks you about each file. Type y to download the files or n to skip it.

tip If you download a nontext file that is unusable, you probably forgot to issue the binary command before downloading the file.

PreviousChapterContentsGlossaryNext