fortypoundhead.com

What is FTP?

Posted On 2008-08-17 by FortyPoundHead
Keywords: Basics of FTP and WS FTP LE tutorial
Tags: General Tutorial 
Views: 1562


FTP, which is an acronym for File Transfer Protocol, is a client-server protocol that allows users to transfer files to and from other computers over a TCP/IP network. FTP has its origins at M.I.T. around 1971, and while it has evolved somewhat over the years, it''s one of the oldest protocols that is still in use and dates back to the days of Unix mainframe computers and dumb terminals. For example, a student at a university would log on to their shell on a campus server with their terminal in the computer lab and invoke an FTP client program to connect to another computer and download course curriculum or research documents, to their home directory. If you were dialing in to the remote shell from home, you could use your terminal program and invoke ZMODEM to transfer the file from your home directory to your local computer.

Today, it''s still used extensively on that big wide area TCP/IP network that we call The Internet. If you''re not familiar with FTP, chances are you''ve used it many times without even giving it a second thought. Many of the download links you click are actually URLs that point to a file on a computer that is acting as an FTP server; your Web browser automatically downloads them.

Quite simply, it is still widely used because it is the most stable and reliable protocol for transferring files over the Internet. This means your download has a greater chance of completing without transfer errors, and intact without corruption. In the FTP specifications, there are strict controls for when the server breaks the FTP session connection with the client, and also strict controls to mark the end of the file data (EOF). Standards are what make platform independent technologies like the Internet possible. Authors of FTP server software, and client software must adhere to the FTP protocol standards (or they won''t be in business long). This rationale ensures reliable communications.

FTP also uses less overhead than other file transfer mechanisms, with fewer packets being sent back and forth to perform the file transfer. The main reason for this is that FTP is able to download files in binary form. When you download a file from a Web server using HTTP (Hyper Text Transfer Protocol), or send/receive a file as an e-mail attachment, the data is first encoded in MIME (no, it''s not a clown that doesn''t talk, it stands for Multipurpose Internet Mail Extensions). Basically, that means your file is encoded as text in the data stream, and converted back to binary on your end. The encoding adds considerable overhead to the transmission.

TCP/IP itself provides exemplary error correction control in that packets have an internal checksum that is compared at the receiving end. If a packet in the sequence is missed, or fails the checksum, the receiving computer initiates a request for retransmission. This is what makes TCP/IP reliable. If not for this mechanism we''d seldom successfully download anything from the chaotic public Internet. Now, you are always using TCP/IP over the Internet and always have this error correction no matter what mechanism you use to download files, but I thought it prudent to mention this here, seeing as FTP relies on it.

The modern FTP specification also has a mechanism for resuming broken downloads. On the server side, markers are inserted in the data streams that correspond to specific locations in the files. Only the server needs to know the specific mechanism used to mark position. On the client side, when your FTP client program requests a resume (usually automatically when you restart a broken download and save to the same directory), it sends the last marker code to the server, which determines the position. Your download then resumes where it left off. It sure beats starting over.

Proper FTP client software gives you more control over what you are doing. Web browsers don''t make very good FTP clients, and their mechanisms to resume broken downloads aren''t very reliable (assuming they exist, that is). There is also a greater risk of encountering transfer errors. I don''t know how many times I''ve clicked on an FTP URL to download a large file with the Netscape browser only to have my download stall at the last few bytes, or abort with a transfer error. Cancel the transfer and start it again, and it starts over from the beginning. Web browsers are really only designed to work as Anonymous FTP clients and if you intend to administer a web site, you will want to use FTP to transfer your files to the directory on the Web server. You will not be able to do that with a web browser.

A very good, no strings attached, free (for non-commercial use) FTP Client that supports resuming broken downloads, is WS_FTP LE from Ipswitch Inc. The Pro version is not free. Download the free LE version of WS_FTP for your OS (e.g. Win32) from:

http://download.cnet.com/downloads/0-10064-101-1572132.html

The tutorial that follows will explain the basic steps to use WS_FTP LE.

Download and install the program. When you first open it, you''ll see the Session Properties dialog box. This is where you specify a server to connect to. For example, if I want to download the Netscape browser, I can connect to ftp.netscape.com with my FTP client and browse for the package I want, instead of using my Web browser to download it. For this type of FTP download from a public site you normally just log on as Anonymous. The password you supply is purely arbitrary, it will accept anything that resembles an e-mail address (and many will accept a blank password). Give your connection profile a name (anything you want). Enter the host name (or numeric IP address e.g. 207.200.85.40) that you wish to connect to, in this case ftp.netscape.com. That''s really all you need to configure; you''ll find that many of the intimidating looking advanced fields in this program aren''t needed for normal use and can be left blank. Click the OK button to connect to the site and save the profile settings.

Lovely isn''t it? Gone are the days of Unix shells and nasty command line utilities. Using a modern FTP client is just like using a file manager. On the left of the two-pane view is the local computer and on the right is the remote computer. On the local computer side, either type the path to the directory you wish to save files to, or double-click the green up arrow to go up a directory level. Double-clicking drives or folders opens them in the pane also. On the remote side, double-click folders to open them or use the green up arrow if you need to go up in the directory tree (at this point, in the root of the public FTP server you''ve connected to, you most likely won''t be able to go up)

As you can see, by using the green up arrow on the local computer side and double-clicking folders, I have chosen my downloads directory on my hard drive. On the remote computer, I double-clicked folders until I got to the directory containing the Netscape download I want, /pub/communicator/english/4.76/windows/windows95_or_nt/complete_install. At this point, I could highlight the cc32d476.exe file and download it. See the two arrows in between the panes? You can guess what those do. Clicking the <- arrow will transfer the highlighted file to the local computer. Before we are ready to do that though, we must set the correct transfer type.

It''s important to note that FTP utilizes two transfer types, depending on what kind of files are being transferred. ASCII mode is for text based files only (e.g. .txt files, .htm and .html files, scripts etc.). Binary mode is for binary files only (e.g. .exe, .zip, .jpg, .gif, multimedia files etc.). If you choose the wrong transfer type for a particular file, you will most certainly corrupt it. The safest thing to do is to manually select the correct mode each time you transfer a file.

Alternatively, you can tell the program what files to download in which mode. Go to Options/Extensions. Enter the file extensions for all files that should be transferred in ASCII mode and add them to the list. Good examples of extensions to add to this list are .htm, .html, .shtml, .log, .c, .cgi. Click OK, then put a check in the Auto box. The program will now check the extension of the files you download and use ASCII mode if the extension matches one in your list, otherwise it will use binary mode. With either Binary or Auto mode selected, you can now highlight cd32d476.exe and click the <- arrow between the panes to download it to your local directory.

What if the connection gets broken, or you get disconnected from your ISP while downloading? Simply reconnect to the FTP site again, and the WS_FTP program will automatically prompt you to resume. Click Yes, and your download will resume - whew!

Having to browse for directories in both panes every time you establish a connection to a particular site is a real pain in the neck. Since ftp.netscape.com is a site you will be accessing again the next time there is a browser upgrade, it would be a good idea to set initial local and remote directories. In Session Properties, click the Startup tab and enter /pub/communicator/english as the Initial Remote Site Folder and C: \Downloads as the Initial Local Folder.

Now, when you connect to the site, the left and right panes will be automatically showing the directories you want to work with.

If you administer a web site, FTP is the best way to transfer files to your web directory on the server. For this usage of the program, you are going to have to log on to the server with a user name and password. Otherwise, the only difference is that you''ll be clicking the -> arrow to transfer selected files to the remote host instead of your local computer.

I recommend that you leave the password field blank and don''t save the password, for reasons of simple security. When you connect to the site, the WS_FTP program will prompt you to enter the password. You wouldn''t want your mean and awful brother or anyone else with malicious intentions to open your FTP program, connect to your web directory, and tamper with your files.

With the Auto box selected for the transfer type, it is safe to transfer multiple files in one session. Hold the Ctrl key while you click on multiple files in the pane and transfer them all at once by right-clicking on the highlighted files and choosing Transfer files or by simply double- clicking on the highlighted files. The program will use the correct transfer type for each file, with no input required from you. When the transfers are complete, the remote pane will automatically refresh and show the updated directory listing.

Now that you know where to get, and how to use an FTP client, you need not use your Web browser for FTP downloads anymore. When you find a file you wish to download on the Web, and on hovering your mouse over the link you see that the URL points to an FTP site (you''ll see ftp://), open up WS_FTP and enter the host name of the site and connect to it. Chances are it will allow anonymous FTP access and you''ll be able to download the file with greater insurance that the download will complete. You won''t panic if your download gets interrupted either, because WS_FTP can resume.


About the Author

FortyPoundHead has posted a total of 1974 articles.


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:54.91.38.173

Before you can post, you need to prove you are human. If you log in, this test goes away.




Recent Forum Posts

Advanced search added
dwirch posted on September 23, 2017 at about 13:44 in Site News

Job Spammer: Gaurav Mehta - AgreeYa Solutions
dwirch posted on September 22, 2017 at about 10:35 in Spammers

Job Spammer: Prutha Siri - Javelin Systems
dwirch posted on September 10, 2017 at about 6:15 in Spammers

New security implemented
dwirch posted on September 7, 2017 at about 7:16 in Site News

Malicious IP Checker Companion Tool
dwirch posted on August 12, 2017 at about 20:24 in Site News

Job Spammer: Steve Adams
dwirch posted on August 8, 2017 at about 7:44 in Spammers