Indiana University
University Information Technology Services
  
What are archived documents?

With FTP from DOS, how do I transfer files?

Connecting to a remote host

  1. Move to the directory on your computer that will serve as your transfer directory (the directory to or from which you'd like to transfer files), for example: cd \temp
  2. At the DOS prompt, enter ftp followed by a space and the name of the remote computer to or from which you want to transfer files.

    If you are using NCSA/Clarkson Telnet and the FTP command doesn't work, try entering ftpbin followed by the name of the remote node.

  3. If you are connecting to an anonymous FTP server, for your username, enter anonymous . For the password, use your complete Internet email address.

    If you are connecting to a computer on which you have an account, then enter your regular username and password.

Commands to use once you are connected

  • To display the current directory on the remote host (the computer to which you connected), at the FTP prompt, enter pwd , for example: ftp> pwd 257 "/" is current directory.
  • To see a list of files in a directory, enter ls . (Some entries have been removed from the following directory lists for greater clarity.): ftp> ls 200 PORT command successful. 150 Opening ASCII mode data connection for file list. bin etc pub 226 Transfer complete. 43 bytes received in 0.05 seconds (0.86 Kbytes/sec)
  • To see more complete information on the files in a directory, enter dir : ftp> dir 200 PORT command successful. 150 Opening ASCII mode data connection for /bin/ls. total 7 dr-xr-xr-x 2 root users 512 May 16 1994 bin dr-xr-xr-x 2 root users 512 May 17 1994 etc drwxrwxr-x 19 root users 512 Nov 1 12:00 pub 226 Transfer complete. 376 bytes received in 0.33 seconds (1.14 Kbytes/sec)
  • If necessary, move to the directory you want by using the cd command, as you would in DOS or Unix: ftp> cd pub 250 CWD command successful.
  • Use cd and ls or dir to move through the directory structure to find the files you are looking for. If you are looking for a web browser for Windows, you will find a directory that looks like this: ftp> ls 200 PORT command successful. 150 Opening ASCII mode data connection for file list. mos20b4.exe n16e11n.exe 226 Transfer complete. 52 bytes received in 0.00 seconds (52000.00 Kbytes/sec) ftp>

Transferring files

  • You will need to select the correct file transfer mode. ASCII mode, used to transfer text files, is the default when FTP starts up. If you need to transfer programs, graphics, or binary data files, set the transfer mode to binary. To transfer a binary file, enter binary at the prompt, for example: ftp> binary 200 Type set to I. ftp>

    To return to ASCII mode, enter ascii at the prompt.

  • To transfer a file from the remote host to your computer, enter get followed by a space and the name of the file. This "gets" the file from the remote host: ftp> get n16e11n.exe 200 PORT command successful. 150 Opening BINARY mode data connection for n16e11n.exe (1599738 bytes). 226 Transfer complete. 599738 bytes received in 1040.68 seconds (1.54 Kbytes/sec) ftp>
  • To transfer a file from your computer to the remote host, enter put followed by a space and the name of the file. This "puts" the file on the remote host, for example: ftp> put weekly.txt 200 PORT command successful. 150 Opening data connection for weekly.txt (129.79.18.191,1136). 226 Transfer complete. 202375 bytes sent in 61.02 seconds (3.32 Kbytes/sec) ftp>
  • To end your FTP session, enter either quit or bye : ftp> quit 221 Goodbye. C:\TEMP>

Also see:

This is document acet in domain all.
Last modified on December 13, 2005.
Please tell us, did you find the answer to your question?