What is FTP

FTP (File Transfer Protocol) is used to transfer files between computers on a Network.

There a several ways to use ftp – here are some of them:

  • From a command prompt – by using the command ftp
  • Directly in a browser by using a url like: ftp://ftpserver
  • Using a ftp client

In this article, we will be looking on the dos command ftp.

First you have to start a dos prompt, by either

chose Run -> Type cmd or command

or simple use the shortcut for the command prompt.

Next you have to move to / create a transfer directory. It is the directory that you would like to use for file transfer. Receive files will be stored here.

This is how you move between directories in dos:

cd\ Go to the root directory (c:\)
cd.. Go one step back. Ex. you are standing in c:\aa\bb\cc a cd.. would place you in c:\aa\bb\
cd directory Go to a specific directory.

Once you are standing in your transfer directory – you are ready for starting a ftp connection.

Type FTP followed by a space and the servername to which you will connect
Ex. ftp my.ftpserver.com

Now a connection to the server is initiated and you will be prompted for a username and password. If you are connecting to an anonymous server, the username is anonymous and the password is a email address. Otherwise use you personal username and password.

If you are connected and have type a wrong password or username. You can type user followed by enter – and you will once again be asked to enter your username and password.

When your username and password has been acknowledged you are ready to move around and transfer files.

To change directories use the cd command
To list files in a directory use the ls or dir command

When you first have found the files that you want to get from the ftpserver you can collect them by doing the following:

If it is not a textfile you have to change the tranfer mode to binary

To transfer a binary file, enter binary at the prompt.
Ex.:

ftp> binary
200 Type set to I
ftp>

and collect the file by using the get command followed by a space and the name of the file.

Ex.

ftp> get demo.exe
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for demo.exe (1019 bytes).
226 File send OK.
ftp: 1019 byte modtaget i 0,01 sekunder 101,90 ved Kbyte/sek.
ftp>

You can transfer a file to the ftp server by using the put command followed by a space and a filename.

Ex.

ftp> put test.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 File receive OK.
ftp: 1019 byte sendt i 0,00 sekunder 1019000,00 ved Kbyte/sek.
ftp>

To end the ftp session use the bye command.

You can leave a response, or trackback from your own site.

Leave a Reply


8 + two =