These notes will help you upload and download files via FTP.
Ftp is not a single program, but rather a convention on a way to send and receive programs. There are many ftp programs, but they all work in a similar way.
The original FTP is a text based program. There is no drag-and-drop.
Before we get started let's make sure we are clear on all the vocabulary.
FTP | "File transfer protocol", a way to send or receive files. |
Server | The computer you will send or recieve files from. Any computer can be a server. A server is simply a computuer that is on the internet which has a website or other public resources available. Most servers are ordinary computers using Windows or Linux. |
Client | Your computer. This is the computer you are sitting in front of when you upload or download files. |
File | The files you want to send or recieve. |
Upload | Send files to the server. Let's suppose you have built a website on your home computer and you want to put it on the server so other people can see it. This process is called "uploading". |
Put | The command to send files to the server. This is one of the commands in FTP. |
Download | Get files from the server. Let's suppose you see a graphic that you want to use on a free images site. You want to get a copy of it so you can incorporate it into your site. This means you need to "download" the file. Or let's say you have a website on the server, and you want to get a copy so you can work on it at home. You need to download the site. Later, after you have made your changes, you can upload them again. |
Get | The command to get files from the server. This is another FTP program command. |
The original FTP was a text based program. There are versions for WIndows, Unix, and Macintosh that are built into the system. This is great because it means you don't have to install any software to get this to work. The original version is Unix, but the Mac and Windows built in versions use pretty much the same commands.
We will discuss how to start the command line FTP in each of these systems, and then we will discuss the commands.
You may also want to read some of the notes we have on files and folders, because locating files and knowing where you are on the hard drive is very important when you are trying to upload and download files.
You can use FTP from the command line from a DOS window.
To open DOS, go to START and select RUN. In the little box type "cmd". This will start DOS.
DOS is basically a black window that allows you to type commands. You can now run Windows FTP the same as UNIX FTP (see below).
The command to start DOS FTP is "ftp www.brandx.net". This will connect you to www.brandx.net, but you can subsitute a different server name if you want to connect to somewhere else. After you type the command, the server will ask you for a username and password. Use the ones you were given in class.
To exit the program, type "quit" or "control-c".
The rest of DOS FTP is the same as the Unix program. We will have a sample session further down in this page.
From a mac terminal window you an run FTP. Terminal is found in the applications folder under Utilities.
The terminal is a black window where you can type commands directly into the Mac system.
If you want to connect to the Brand X Web server, use this command from the terminal
ftp www.brandx.net
The server will ask for a username and password.
From the terminal window the commands will be the same as UNIX FTP.
To use FTP, the first step is to log into a server with our username and password.
Then we can use commands to send and receive files.
The "put" comand sends files (uploads the files you want to send) to the server.
The "get" command receives files (downloads the file you ask for).
Here's a more complete list of commands:
get myfile | Download (receive) this file. Subsitute the name of the file you want for "myfile". Note that if you are in the wrong folder or if you spell the name of the file wrong, it won't work. |
put myfile | Upload (send) this file. Subsitute the name of the file you want for "myfile". Note that if you are in the wrong folder or if you spell the name of the file wrong, it won't work. |
ls | List the files on the server in the current directory. This gives you the names of the files, but not size and ownership. Listing the files can be very helpful if you are having trouble spelling the names of things, or if you aren't sure where you are on the server or what you are looking at. |
ls -al | List files on the server, inthe current folder, with details. This includes ownership, size, date, and permissions for each file. |
delete filename | Delete this file from the server |
rename filename | Rename the file on the server |
mkdir dirname | Create a directory called dirname on the server |
cd dirname | Move to this directory on the server |
pwd | Show the current location on the server, with complete path. If you are confused about what folder you are in on the server, this will help. Note that this does not tell you where you are on your home computer, we are talking about the server. |
cd ~ | Move to my home directory on the server. If you are confused about where you are this can be very helpful because it puts you back where you were when you first logged in. |
cd .. | Move up one layer in the directory tree |
lcd dirname | Move to this directory on your computer. This is different than changing folders on the server. Usually it is easier to start in the right directory before you open the ftp program, but you do have some ability to navigate on your home computer even when you are in FTP. |
help | Get help. This will list the options for FTP. |
quit | Quit the program and return to Dos/Unix/Mac system. |
We will start from the beginning.
First open DOS. From the start menu, select "run", put "cmd" in the run box, and hit enter. This will open a black DOS window where we can type our commands.
Here's my conversation with the server. The things in green are what I typed.
Microsoft Windows [Version 6.0.6001] Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\Users\jimp>ftp www.brandx.net <-- Enter the name of the server here Connected to www.brandx.net. 220 Welcome to the server WWW.BRANDX.NET User (www.brandx.net:(none)): lacc-student <-- Enter your username here 331 Please specify the password. Password: <-- Enter password. Note: FTP does NOT show your password! 230 Login successful. ftp> ls <-- Enter ls to list files 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. ADBEPHSPCS3_WWE.exe Aida.html AniDanielyan2.html Arman . . . jacklinlarian.html~ jim.txt jimpickrell jimpickrell.html jimpickrell.html~ jimpickrell2.html joan.html joanbryant,html . . etc. etc. etc.. 226 Directory send OK. ftp: 2091 bytes received in 0.19Seconds 10.83Kbytes/sec.
Let's download a file
ftp> get telephone-jim.html <-- The get command downloads a requested file 200 PORT command successful. Consider using PASV. 150 Opening BINARY mode data connection for telephone-jim.html (588 bytes). 226 File send OK. ftp: 588 bytes received in 0.00Seconds 588.00Kbytes/sec.
Note the response here from ftp that tells us the download worked. Now let's send this same file back to the server.
ftp> put telephone-jim.html <-- The put command uploads my file to the server 200 PORT command successful. Consider using PASV. 553 Could not create file.
What went wrong? This file already exists. Let's rename it. Then we can upload.
ftp> rename telephone-jim.html telephone-jimpickrell.html <-- The rename command renames a file that is on the server 350 Ready for RNTO. 250 Rename successful. ftp> put telephone-jim.html <-- The put command uploads my file to the server 200 PORT command successful. Consider using PASV. 150 Ok to send data. 226 File receive OK. ftp: 588 bytes sent in 0.05Seconds 12.00Kbytes/sec.
Let's list out the files and see what we have. In order to keep it quick let's only list out files that start with jim.
ftp> ls jim* <-- Enter "ls jim*" to list files that start with "jim" 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. jim.txt jimpickrell jimpickrell.html jimpickrell.html~ jimpickrell2.html 226 Directory send OK. ftp: 78 bytes received in 0.01Seconds 6.50Kbytes/sec. ftp> quit <-- Enter "quit" to exit FTP 221 Goodbye. C:\Users\jimp>
Done so we have logged out.
If you want to use a drag and drop version of FTP try "Core FTP" which can be downloaded from CNET (download.com). Download.com is generally a good place to get free software; it is less likely to have viruses than other sources.
Another new choice that is very popular is "Filezilla" which can be found at http://download.cnet.com/FileZilla/3000-2160_4-10308966.html
Documentation for Filezilla is found at http://wiki.filezilla-project.org/Documentation.
FTP is built into Dreamweaver. We will see how that works later.