document.write (''); 怡红院 FTP Basics

FTP

File Transfer Protocol

Only a small subject. Doesn't need much explanation, I hope. If this doesn't make sense please email me and I'll improve it...

FTP is a method for transferring files across the internet, usually between your own computer and a remote computer(server). It is readily supported by new operating systems (Windows 9x, UNIX, Windows NT, Linux...) and is supported too by many older systems that can access the internet.

The easiest way to see if you have it installed is to type from a DOS prompt: or Command Line Interface

FTP

If the prompt changes, it's installed. At this point you are in the FTP environment and have started an FTP session. Alternatively you can download various graphical FTP programs which allow you to drag and drop files, rather than needing to type everything in. There are some examples and links at the end...

Here is a list of the most basic commands, followed by an example

Command Syntax Example Notes
help help <command> help open on its own shows a list of commands used with a command will show the syntax
open open <ftp address> open ftp.microsoft.com open a remote file system
disconnect disconnect disconnect close the ftp session
cd cd <directory> cd cgi-bin change directory can also take .. to go up a level
dir dir <directory> dir cgi-bin can be used on its own to show the current directory contents
bye bye bye quite the FTP environment
hash hash hash show hashes to represent blocks of data transferred
asc asc asc changet to ASCII file transfer mode (for text files, HTML pages etc...)
bin bin bin change to Binary file transfer mode (executables, images...)
       
! !<local command> !dir runs a system command, ie a command native to your computer / operating system
get get <filename> get index.html copy a remote file to your local computer
put put <filename> put index.html copy a local file in the current directory to the remote server

Here is a fairly typical ftp session to upload(copy from a local computer to a remote computer) a file (myfile.html):

Key:   Typed in by the user , Example computer response

c:\ > ftp ftp.mysite.com
Connected to ftp.mysite.com.
220
User (ftp.mysite.com:(none)):
rathmeile
331 User name okay, need password.
Password:
mypassword
230 User logged in, proceed.
ftp> asc
200 Type set to A.
ftp> cd cgi-bin
250 Directory changed to rathmeile/cgi-bin
ftp> put myfile.html
200 PORT Command successful.
150 Opening ASCII mode data connection for myfile.html.
226 Transfer complete. 3491 bytes sent in 0.00 seconds (3491000.00 Kbytes/sec)
ftp> bye
221 Goodbye!
c:\ >

In most FTP sessions however the messages given will most likely be different. Each FTP system allows the messages given to users to be changed, so instead of Goodbye it may well say Ciao. Likewise the messages given could be the terms and conditions of use once you connect.

Here are two more commands, they can be "quite" useful:

Command Syntax Example Notes
prompt prompt prompt will toggle prompting. can be used to stop ftp asking if you want to download each file (and just get on with it!) with mget for example.
mget mget <filemask> mget *.html on its own a prompt will ask you for a filemask, essentially use a * to represent anything and add bits, *.html will get anything ending in .html (all HTML files)

 

 

Some examples of FTP transfer programs are:

You can either go to the publishers webs sites (above) to download them or go to a download site, such as www.download.com or www.TuCows.com. Just go to them and search for FTP.

From your browser you can [usually] quickly use FTP by typing in the FTP details in to the address bar. So instead of typing:
http://www.rathmeile.org
type the ftp details for the server you want to connect to, the syntax is: ftp://USERNAME:PASSWORD@ADDRESS
For example: ftp://ftpUsername:ftpPassword@ftp.rathmeile.org

If you have any further suggestions, comments or questions, just email me: tim@starmail.com