Uncreative Labs How Tos:
Networking and related

How to use Windows built-in FTP
By Matt Brault
Revisions suggested by F7.

Introduction

There's a whole world of files available using FTP. File Transfer Protocol, or FTP, allows you to transfer files without a specific graphical interface. In fact, since FTP is a protocol, and not a program itself (more on that in a minute) it is usable with almost any Operating System. Often, an Operating System install includes a program that implements FTP, and calls it (surprise) "ftp."

The FTP program included with the operating system is not the only program that can use FTP. There are many programs that make use of FTP, and provide extra capabilities (for example, WS_FTP allows you to select a file and view it automatically, rather than you downloading it, then starting your viewing program, and opening the file.) Do not limit yourself to just Windows FTP, other programs may provide enhanced capabilities, or simply be more convienient. (A web browser often has FTP built in, so all you need to do is follow a link.)

When using FTP, note the case (capitolization) of the file name. MYFILE.TXT is not the same as MyFile.txt or myfile.txt. (This reflects the Unix-based design of TCP/IP standards (what the Internet runs on.) MS-DOS was not introduced until well after TCP/IP was designed.)

Command Reference

The following syntax is used for commands:
Required words are in bold, varying words are in italics, and the description is in normal text.

Log on and Log Off

  open server name
    Open a connection to the server.

  user
    Log in as this user (the system will normally prompt you.)  This is used if authentication fails.

  disconnect
    Disconnect from the server, but do not close Windows FTP.

  bye
    Disconnect from the server and close Windows FTP.

  ?
    Show commands (help.)

Navigation

  cd directory name
    Change Directory to the directory name supplied.  Use ".." to move to the
  parent directory, and "/" to move to the system root directory.

  lcd directory name
    Local Change Directory.  This changes to a directory local to the computer.
  See also "cd".

  ls options
    List directory contents (think of LiSt to remember this.)

    Common Options are:
    -l  Long format          Example Image of -l option.
    -F  Full Format          Example Image of -F option.
    -lF Long and Full format Example Image of -lF option.


File Handling

  get remote file
  mget remote files
    Get a file from a remote system.  mget gets multiple files from a remote system.

  put local file
  mput local files
    Put (upload) a file on a remote system.  Like mget, mput puts multiple files on the remote system.

  delete remote file
    Delete a file from a remote system. (Windows FTP does not do this locally.)

  mkdir directory name
    Make a directory called directory name on a remote system.

  rmdir directory name
    Remove a directory called directory name on a remote system.

  rename original name new name
    Rename original name to new name.

File Transfer Modes

  ascii
    Set transfer mode to ASCII. (Text files and the like.)

  binary
    Set transfer mode to binary.  (Programs and other files.)

Using Windows FTP

Now that you have the commands available, let's go somewhere! Start the ftp program. This can be done a number of ways, but the easiest way is to type "ftp server name" or "ftp ip address in the Run box, or command prompt. After that, the system will authenticate you. If you are logging in to an anonymous FTP server, make sure you use "Anonymous" (exactly like that) as your login name, and some email address for a password. (Personally, I use fake@fake.org. If you use your real email address, it's not really anonymous, is it?)

Once you've logged in, you'll have the FTP prompt. At the prompt is where you can enter the commands you want, one command at a time. Most of the time, you simply navigate to where you want to work, and do what is is you want to do.

  |-------------------------------------------------------------|
  | Note -- Permissions                                         |
  |-------------------------------------------------------------|
  |                                                             |
  |      Some FTP servers (especially those allowing anonymous  |
  | access) do not allow you to do certain things.  Often, this |
  | includes uploading files, creating directories, and deleting|
  | files.  If you have trouble uploading files, perhaps you    |
  | are not allowed to.  (Sometimes you cannot upload files to  |
  | a specific folder, while others will work fine.)            |
  |                                                             |
  |-------------------------------------------------------------|

Getting a file

1. Log in to the server you wish to use, let's say it's ftp.fake.com.

  ftp>open ftp.fake.com (cr)
Note: (cr) means press enter.

2. Enter your username and password. If nothing appears on screen when entering the password, do not worry, this is normal.

   user: how-to_reader (cr)
   password: ********* (cr)

          or

   username: Anonymous (cr)
   password: ************* (cr)

3. Navigate to where your file is. Let's say it's two subdirectories deep in the downloads folder.

  cd ftpusers/downloads (cr)

4. Issue the get (or mget) command to start download of your file. (Note: To put a file, use put rather than get.)

  get myfile.txt (cr)

5. The file downloads to wherever your local directory is set to, probably C:\my documents\your name. Use lcd to change that.

Congratulations, you're done!

Questions and Answers (It's easier to explain this way.)

Q. How do I download a file to a place other than the default?
A. Use "lcd directory name to change the local directory.

Q. How do I know where my file is located?
A. You can use the "ls" command to view a listing of the files in a directory. Files will often have extensions, and directories will often have a slash or nothing after their names.

Q. I downloaded/uploaded this picture, and it's garbage!
A. Take a better picture.
A'. The file may have uploaded in the wrong mode. If you have the original, upload it in binary mode. If not, download the picture and upload it again, using a different mode.

Q. I can't log in!
A. Perhaps you aren't supposed to. Contact the administrator of the FTP server if you think you should be able to log in.

Q. I think program name is much better.
A. So do I. But perhaps the user's computer you're trying to fix doesn't have program name. That's what makes Windows FTP so useful. Also, the commands used here are fairly standard, so Darwin's (Mac OS X) ftp program also uses them, as well as many Linux FTP programs.

Q. Nothing appears on screen when I type my password!
A. That's supposed to happen. By not displaying asteriks on screen, it is difficult for someone looking over your shoulder to determine the length of it. If, for some reason you use a short password, it's only a matter of time before a determined person can get it.

Conclusion

So there you have it, a simple guide to using Windows FTP. FTP is one program that follows the common phrase, "Do one thing and do it well." There's no extra bells and whistles added, just what you need to easily move files from one place to another. Early versions of FTP didn't allow use of some commands, such as lcd or maybe mget. I have not run in to this in the Windows FTP program, so don't worry about it.