Command Prompt and FTP Lab

CS 102

Feb. 15, 1999

In this lab, you'll use the command prompt and the file transfer protocol (FTP) to publish your small web page.

  1. First, you need to remember the folder where your web page and image are. Search through My Computer for it if you don't remember. Write down the path name, including the drive letter. For example, g:\kelliher\html.

  2. Now, we want to get to a command prompt. Open the Start menu, go up to Programs, and find and run the Command Prompt. Any of you who have ever worked with DOS will recognize this old friend (or foe).

    Carefully note the command prompt. It starts with a drive letter. This is how you know you're at the command prompt and not running another program.

  3. We want to change to the correct drive. The command to do this is just a drive letter followed by a colon:
    g:\kelliher> s:
    
    s:\>
    
    Look back at the path to your web page folder. Change to the drive that your web folder is on.

  4. Now it's time to navigate to the web folder. We use the cd (change directory) command for this. The following example demonstrates how to use this command.
    g:\kelliher> cd web
    
    g:\kelliher\web> cd ..
    
    g:\kelliher> cd html
    
    g:\kelliher\html>
    
    Note:
    1. The prompt lets you know where you are in the folder hierarchy.

    2. You can only cd into a folder that's contained in the current folder.

    3. To move up a folder type
      cd ..
      
      and to move to the drive's root folder type
      cd \
      
      Experiment a little.

  5. Let's verify that you're in the correct folder. Display a directory listing by running the command dir. You should see two files listed: index.htm and baltmap.jpg. If you don't, call me over.

    Remember the names of the two files. Both form your web page.

  6. Now, we're ready to run the ftp program to transfer the files to phoenix (the web server). Type
    ftp phoenix
    
    You will be prompted to enter a user name and then a password. Enter them from the phoenix account information I gave you earlier.

    If all goes well, you are logged in and have an ftp prompt:

    ftp>
    
    If you receive the message login failed use the user command in ftp with your user name to start over:
    ftp> user kelliher
    
    You will be prompted for your password again. If you cannot seem to get logged in, call me over. The most common login problem is mis-typing the password, so be careful with that. Letter case matters.

  7. After you login to phoenix, note the ftp prompt:
    ftp>
    
    Run the binary and cd commands to prepare for transferring the files:
    ftp> binary
    
    ftp> cd public_html
    
    Run the pwd (print working directory) command to verify that you're in the correct folder on phoenix. For example:
    ftp> pwd
    257 "/home1/kelliher/public_html" is current directory.
    
    What's important here is that the last component of the path you see is public_html.

  8. Now, we're ready to transfer the files. The put command is used to do this. Here's an example:
    ftp> put index.htm
    
    ftp> put baltmap.jpg
    
    Then, use the dir command in ftp to list the files in the current folder on phoenix. You should see the two files you just put there, plus some others.

  9. You're done. Run the quit command in ftp to leave ftp and then run the exit command in the command prompt to leave that.

  10. Let's see if you published your page correctly. Start Internet Explorer and enter your URL. For example:
    phoenix/~kelliher/
    
    Note the ~ character in front of the user name. The ~ character can be found to the left of the 1 key on the top row of the keyboard.

    Well, is your web page out there on the Internet?



Thomas P. Kelliher
Mon Feb 15 08:42:21 EST 1999
Tom Kelliher