May 27, 2001
By

Ryan M. Suenaga

File Transfer Protocol (or FTP for short) is the standard way to transfer data between computers on the Internet. Most of the computer platforms capable of TCP/IP connections to the Internet have at least one if not more FTP client programs.

File Transfer Protocol is important to those of you using Apple IIs because a vast collection of software is available on Apple II oriented FTP sites. In fact, Syndicomm.com recently opened its members-only FTP site with more than 1 gigabyte of Apple II software and related files. It’s the largest online collection of its kind available anywhere! So, to get in on this bonanza, besides being an A2Central.com member, it’s important to know how to use FTP efficiently and effectively.

History

FTP isn’t quite as old as the Internet, but it’s certainly not brand new. The document that describes the FTP standard (which can be read at http://www.faqs.org/rfcs/rfc959.html) dates back to 1985. FTP was designed to promote sharing of files between users, to encourage use of remote computers, to give a uniform interface for dealing with storage systems on other computers, and to provide a reliable and efficient method of transferring data.

Today, FTP is a way to get data from computers on the Internet onto your computer at home. Typically, files are located on a FTP server on the Internet and transferred to your home computer via an FTP client. We’ll take a closer look at this process in a little bit, but first let’s address some issues those of you who’ve been using telecommunication for years may have with the term “protocol.”

XModem Is Too A Protocol

Many of you old time Apple II users are probably saying, “I transfer files from a remote system to my Apple II all the time with XModem!” While XModem (and its cousins YModem and ZModem) have been referred to as “protocol” transfers–and indeed they are protocol transfers–they aren’t the type of transfers we’re talking about here. These type of transfers are meant to be used over direct dialup or direct serial connections. While they are sometimes used over TCP/IP telnet connections, they really were never meant to do so. FTP is a faster and more reliable method for transferring files over a TCP/IP connection.

XModem/YModem/ZModem transfers do have a place in this discussion, however, particularly when you use a UNIX shell account. We’ll discuss that a little later.

I Want To Serve You Up

FTP works on a server-client model. The server is usually a well-known FTP site on the Internet. The client is you, or rather, your computer. There is, however, nothing to stop you (save possibly a lack of software) from it being the other way around, or for an FTP server to be a computer on your local area network rather than somewhere out there on the Internet. As a client you can upload (put) and download (get) files to and from the server.

Start Me Up With FTP

You will need to know a few things–for starters, a list of available FTP sites. You will also need to have a username and password, or at least know enough about anonymous FTP to know what to put in for a username and password.

Anonymous and Not So Anonymous

What is this about “anonymous FTP” anyway? Anonymous FTP is a way of referring to publicly accessible FTP sites that you don’t need an account on to access. For instance, many software companies have publicly accessible sites that hold repositories of documentation, software updates, and other files. While you don’t need an account on the system to obtain these files, you do need to enter something for your username and password. At these sites, you can simply enter “anonymous” (or, commonly nowadays, “ftp”) as your username. If you use “anonymous” as your username, it’s commonly accepted practice to enter your email address as your password.

Oh, and by the way, these anonymous FTP sites aren’t all that anonymous. Even if you enter a false email address, they usually log the actual IP address you’re connecting from. Don’t get a false sense of security.

FTP on a UNIX Shell

Probably the best way to explain how to use FTP is to discuss how to transfer files using the FTP program available on most UNIX shells. This command line interface based FTP program is very bare bones, but it offers users some insight into just how FTP works.

Assuming you have a UNIX shell account with a prompt that looks like this:

rsuenaga@cathy:~$

You can invoke the FTP program by simply typing “ftp” and hitting return.

rsuenaga@cathy:~$ ftp

You should then get a prompt similar to:

ftp>

After which you can enter a site where you’d like to either obtain or contribute files. Let’s use ftp.syndicomm.com as an example here:

ftp> open ftp.syndicomm.com

After you hit return, you’ll see something like the following:

220 ftp.syndicomm.com FTP server (Version wu-2.6.0(1) Fri Jun 23 09:17:44 EDT 2000) ready.
Name (ftp.syndicomm.com:rsuenaga):

If I want to sign in using anonymous FTP, I enter “ftp” or “anonymous” followed by return:

Name (ftp.syndicomm.com:rsuenaga): ftp
331 Guest login ok, send your complete e-mail address as password.
Password:

I then enter my email address as the password and hit return. You’ll notice it won’t show up on my screen. I then get something like the following:

Password:
230-This is a welcome.msg
230-
230-
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

If instead of signing in anonymously I want to sign in with my username and password, I simply substitute them when prompted.

You’ll notice we’re transferring files in “binary” mode. We can also transfer files in “ASCII” mode. What’s the difference? ASCII is generally just good for transferring text (ASCII) files. Binary can transfer both text and non-text (mostly program) files, although you may need to set the filetype of a text file transferred as binary manually (using, say, File-A-Trix or some similar utility). If we want to change from binary mode to ASCII mode, we simply type “ascii” followed by the return key (note that it’s in lower case):

ftp> ascii
200 Type set to A.
ftp>

If we want to switch back to binary mode, we type in “bin” followed by return:

ftp> bin
200 Type set to I.
ftp>

I usually recommend people just stick with binary transfers.

We probably want a directory listing so we can see what files and folders are out there on the server. To do so we can try a few different commands–depending on the server and the client, “ls”, “ls -l”, and “dir” will work.

ftp> ls -l
200 PORT command successful.
150 Opening ASCII mode data connection for directory listing.
total 48
d--x--x--x   2 root     root         4096 Sep 19  2000 bin
d--x--x--x   2 root     root         4096 Feb  2  2001 etc
d--x--x--x   2 root     root         4096 Sep 19  2000 lib
drwxrwxr-x  11 500      50           4096 Apr  1 07:19 pub
drwx--x--- 126 root     513          4096 May 12 13:18 users
-rw-r--r--   1 root     root           23 Apr 11 02:56 welcome.msg
226 Transfer complete.
ftp>

Some of these are directories and some are actual files. “pub” is a directory (shorthand for “public”). Let’s change directories into there, using the “cd” command:

ftp> cd pub
250 CWD command successful.

Then get another directory using ls:

ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for directory listing.
total 72
drwxr-xr-x   4 500      508          4096 Oct 23  2000 a2pro
drwxr-xr-x   5 500      508          4096 Oct  3  2000 apple
drwxr-xr-x   3 500      50           4096 Oct  9  2000 collections
drwxr-xr-x   2 500      508          4096 Dec  9  2000 documents
drwxr-xr-x   2 root     root         4096 Apr  1 07:20 emulation
drwxr-xr-x   4 500      508          4096 Jan 18  2001 gsos
drwxr-x---   3 575      513          4096 Apr 11 02:25 members-only
drwxr-xr-x   3 500      50           4096 Aug  5  2000 newsletters
drwxr-xr-x   4 500      508          4096 Jan 15  2001 prodos
226 Transfer complete.
ftp>

If I wanted to go “up” a directory (to the one I was in before this, I use the cd command again, this time with two periods after it:)

ftp> cd ..

I don’t want to do that, however. I really want to just go into the “newsletters” directory, and within that, and the “a2n” directory within that. I can do it all in one fell swoop this way:

ftp> cd newsletters/a2n

Then I get another directory:

ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for directory listing.
total 152
-rw-r--r--   1 500      508         13936 Aug  6  2000 a2n0008.txt
-rw-r--r--   1 500      508          4999 Sep  1  2000 a2n0009.txt
-rw-r--r--   1 500      508          4329 Oct  5  2000 a2n0010.txt
-rw-r--r--   1 500      508          7577 Nov  6  2000 a2n0011.txt
-rw-r--r--   1 500      508          4858 Dec 14  2000 a2n0012.txt
-rw-r--r--   1 500      508          4940 Jan  8  2001 a2n0101.txt
-rw-r--r--   1 500      508          6129 Feb 12  2001 a2n0102.txt
-rw-r--r--   1 500      508          3166 Mar 15 07:19 a2n0103.txt
-rw-r--r--   1 500      508          4925 Apr  9 14:01 a2n0104.txt
226 Transfer complete.
ftp>

Okay, now let’s say I want to get one of these files. It’s simple enough. All I have to do is use the “get” command along with one of the filenames. So, in this case, let’s get a2n0104.txt.

ftp> get a2n0104.txt
local: a2n0104.txt remote: a2n0104.txt
200 PORT command successful.
150 Opening BINARY mode data connection for a2n0104.txt (4925 bytes).
226 Transfer complete.
4925 bytes received in 0.244 secs (20 Kbytes/sec)
ftp>

All that means now is that the file resides in the current directory on my UNIX shell. We’ve got it!

I can find that file by quitting ftp (a number of commands work for this, usually including “bye” and “exit”):

ftp> exit
221-You have transferred 4925 bytes in 1 files.
221-Total traffic for this session was 7705 bytes in 1 transfers.
221-Thank you for using the FTP service on ftp.syndicomm.com.
221 Goodbye.
rsuenaga@cathy:~$

I then get a directory:

rsuenaga@cathy:~$ ls
Mail/                     kfest.bxy
Network\ Trash\ Folder/   links-0.95/
News/                     lynx.cfg
SCSIUtils.sdk             lynx_bookmarks.html*
Setup.sdk                 mail/
TheFindByContentFolder/   minefield.shk
TheVolumeSettingsFolder/  netatalk-1.4b2/
a2n0102.txt               netatalk-1.4b2.tar
a2n0104.txt               news:3a47956b.374295\@newsb.myexcel.com

rsuenaga@cathy:~$

and you will see that in my rather messy directory, the file a2n0104.txt does exist.

If instead of getting files, I want to give (“put”) files, things are only a little different. I want to use the put command rather than the get command. I also must know the correct filename of the file I want to put as it’s listed in my directory. Additionally, most FTP sites have a particular directory for putting files, usually called “incoming”. But, assuming all of these are in place and I want to put the file a2n0102.txt, it looks something like this:

ftp> put a2n0102.txt
local: a2n0102.txt remote: a2n0102.txt
200 PORT command successful.
150 Opening BINARY mode data connection for a2n0102.txt.
226 Transfer complete.
6129 bytes sent in 0.0297 secs (2e+02 Kbytes/sec)
ftp>

All of that said, there’s usally an alternative to the rather minimal command line FTP program on most UNIX shells: ncftp. Try that, it’s much better.

Once you have the program on your UNIX shell account, you have to actually transfer it to your Apple II. For most folks this is where the XModem/YModem/ZModem transfers come in (I told you we’d get to this eventually). A ZModem transfer is usually invoked with a “sz filename”, YModem with a “sb filename”, and XModem with a “sx filename”. You’ll then have the file on your Apple II.

FTP on Other Platforms

Web Browsers and FTP

Most (but not all) World Wide Web browsers include a FTP component. Netscape Communicator, Microsoft Internet Explorer, and even the ubiquitous Lynx and Links browsers all contain the ability to perform FTP. To access an FTP site, simply use a Universal Resource Locator of the form:

ftp://ftp.domain.com/

Where “domain.com” is the name of the FTP server you’re trying to access. If you’d like to access a particular directory or file, simply add them onto the URL:

ftp://ftp.domain.com/directory/file

If you are accessing a non-anonymous FTP site where you must include a username and password, you can use a URL in the following format:

ftp://username:password@ftp.domain.com

or if you’d like to access a particular directory or file:

ftp://username:password@ftp.domain.com//directory/

or

ftp://username:password@ftp.domain.com//directory/file

FTP by Electronic Mail

If you only have access to email, you can still get files via FTP. It’s called FTP by email. It’s an old, cumbersome, slow method, but for folks who have no other choice, it provides a way to get to files.

Covering FTP by email would take an entire article in and of itself; suffice it to say that there are several articles and tutorials on the subject available on the World Wide Web. You can find a useful tutorial in the form of a Frequently Asked Questions (FAQ) file here:

http://www.faqs.org/faqs/internet-services/access-via-email/

Thanks Geoff

There is one native FTP program available for the Apple IIGS–it’s gwftp by Geoff Weiss, the well-known Apple II programmer. gwftp uses a command line (text) interface and operates very similarly to other text based FTP programs. There is one known problem with gwftp–it will crash on closing your connection to the FTP server. The crash is currently attributed to difficulties encountered by the IIGS TCP/IP stack (Marinetti). gwftp is available from Shareware Solutions II, Juiced.GS, and, if you can still access it, the Delphi textside A2 Database.

In addition, the Arachnid World Wide Web browser, the in-progress project of Australia’s Kim Howe, is able to obtain files by FTP. It does not, however, display directories yet, so you must know the full URL of the file you want. Arachnid is available at:

http://www.syndicomm.com/~kimhowe/

All Over But The Shouting

FTP is becoming more and more important for the Internet connected Apple II user. More and more software is being made available via FTP. Hopefully this will help clear up how to use FTP effectively and efficiently for Apple II users. Apple II (software via FTP) forever!