Ryan Sechrest Freelance Web Designer & Developer

27Jul/100

How to: Use command prompt to connect to Web server via FTP

FTP via Command Prompt

Sometimes, the simpler, the better. In just a few steps you can connect to a Web server via FTP using nothing but good ol' command prompt. Let's start by opening command prompt. Go to [Start], [Run], and then type in "cmd" and press ENTER on your keyboard or click on OK. You will see a black window open up. Time to connect via FTP.

  1. Type in "ftp" and press ENTER.
  2. Type in "open domain.com" and press ENTER.
  3. It should say welcome now and ask for a user. Type in your username and press ENTER.
  4. It should say user OK. Now type in your password and press ENTER. Note that the password will not be displayed.
  5. If it now also says OK, you are connected.

What can you do? We'll let's look at the directory you are in.

  1. Type in "dir" or "ls" (and press ENTER) to view either detailed directory/file information or simply a list of files, respectively. You are looking at the files on the server.
  2. To view files on your computer, type in "lcd" and press ENTER.

Let's upload a file.

  1. First, browse to the file using "lcd". If the file is on your desktop for example, type in "lcd desktop" and press ENTER.
  2. Now we'll create a new folder on the Web server to upload the file to. Type in "mkdir test" and press ENTER to create a folder called "test".
  3. Let's now upload the file on your desktop into that folder. First, browse to the folder "test" by typing "cd test" and pressing ENTER.
  4. Now we are on the Desktop locally and in the folder called "test" on the server. Type in "put filename.ext" and press ENTER to upload a file. This could be "test.txt" or whatever, as long as this file exists on your desktop.
  5. The file should now be uploaded. You can verify that by going to: domain.com/test/filename.ext using your Web browser.

Since we're done with this tutorial, type in "bye" and press ENTER to disconnect from the Web server.

If you have any questions or comments, please feel free to leave them!

-Ryan

Share and enjoy:
  • Facebook
  • Twitter
  • Digg
  • del.icio.us
  • Technorati
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.