Academic Computing Services
QUICK STUDY #26
March 2001

Transferring Files on a PC Using FTP

You can use the Internet File Transfer Protocol, or FTP, to transfer text files, graphics files, and programs between computer accounts on various host computers. You can also use anonymous FTP to transfer files to your Rensselaer Computing System (RCS) account from public accounts on many remote hosts that allow you to log on without having an account at that site.

You can initiate FTP in two ways: either by running the utility from your PC's Start menu, or entering the ftp command from an MS-DOS prompt.


To Run FTP from the Start Menu...


1.
Open the Start menu on your machine's desktop, and select the Run... option. A separate Run window will appear.
2.
In the Open: field, type ftp hostname, replacing hostname with the name of the remote host. For example, the hostname for RCS is ftp.rpi.edu.
3.
Press the Enter key, or click on the OK button.

To Run FTP from the MS-DOS Prompt...


1.
Open the Start menu on your machine's desktop, and select the Programs option.
2.
Select the MS-DOS Prompt option from the pop-up sub-menu that appears. A separate MS-DOS window will appear, showing the current path of C:$\backslash$WINDOWS.
3.
If you wish to relocate to another path (folder) on your PC, you may do so at this point by issuing the command cd .. at the caret (>) prompt; this will move you up to the top level directory on your C: drive. Next, issue the command cd foldername, replacing foldername with the name of the folder in which you wish to place, or from which you wish to send, the FTP-transferred file(s).
4.
Enter the command ftp hostname (e.g., ftp ftp.rpi.edu).
However you initiate your FTP session, a separate FTP window will appear after a few seconds, stating that you are connected to the FTP host. A prompt will also appear, asking you for your name or userID. If you are accessing an account you own, such as your RCS computing account, enter the appropriate userID. If you are accessing an anonymous FTP site, enter the name anonymous. Please note that some FTP sites have a lot of people trying to connect during business hours, so they either restrict access to a certain number of connections or allow access only during certain hours. If you reach such a site, you might receive a message asking you to try again later.

However, if you connect to the site successfully, the host will prompt you for a password. If you have an account on that host, such as on RCS, enter your account password. If you're using anonymous FTP, enter your entire electronic mail address -- for example, smithj@rpi.edu -- as your password. Once you are connected, you should see an ftp > prompt, although the exact prompt may vary from one server to another. You can now use the cd (change directory) command to reach the directory that contains the file you want. You can also use the ls or dir commands to view the files in the current directory.

Once you've located the file you want, determine whether it's a text file, which contains plain ASCII text, or a binary file, which can contain things like graphics or compiled programs.

The FTP transfer mechanism is set for text by default. If you wish to transfer a binary file, be sure to enter the command binary before transferring the file.

Retrieving Files

The commands you use to transfer the desired file(s) varies slightly, depending on how you initiated your FTP session.

If you started FTP by running it from your PC's Start menu, you would enter the following command at the ftp > prompt, replacing filename with the name of the file you wish to retrieve, and foldername and newfilename, respectively, with the name of the folder and file under which you wish to place the file:


get filename c:$\backslash$foldername$\backslash$newfilename

If you started FTP by issuing the ftp command from an MS-DOS prompt, and have already relocated to the folder in which you wish to receive the file, enter the following command at the ftp > prompt, replacing filename with the name of the file you wish to retrieve. Use the newfilename option if you wish to receive the file under a different name.


get filename newfilename

Sending Files from Your PC to RCS

Just as you can use FTP to retrieve your RCS files onto your PC, you can also send your PC files over to your RCS space. And, similarly, the commands you use to do this vary slightly, depending on how you initiated your FTP session. In either case, however you perform the transfer, the first thing you will probably want to do during your FTP session is use the cd command to relocate to the RCS directory in which you wish to put your PC file.

If you started FTP by running it from your PC's Start menu, you would enter the following command at the ftp > prompt, replacing foldername and filename, respectively, with the name of the folder and file you wish to transfer. Use the newfilename option if you wish to receive the transferred file under a different name.


put c:$\backslash$foldername$\backslash$filename newfilename

If you started FTP by issuing the ftp command from an MS-DOS prompt, and have already relocated to the PC folder from which you wish to send the file, enter the following command at the ftp > prompt, replacing filename with the name of the file you wish to transfer. Again, use the newfilename option if you wish to receive the transferred file under a different name.


put filename newfilename

Quitting the FTP Session

When you're done with the file transfer, enter the command bye or quit at the ftp > prompt.

Getting More Information

If you ever need on-line help at any time during your FTP session, you may either enter a question mark (?) or the help command at the ftp > prompt. You may also refer to Memo RPI.117, Transferring Files: Using FTP in UNIX, for more information.


About this document ...

Published by Academic Computing Services, RPI, Troy, NY 12180

Send comments to consult@rpi.edu.