San Jose IBM PC Club

FTP Procedure Using Command Prompt

There are many ways to upload web pages to the server.  The following method uses the internet file transfer protocol, FTP.  It will work on any Windows computer.

1) Click Start, All Programs (or Programs), Accessories, Command Prompt to open the Command Prompt dialog box.  Change to the directory that has the files you want to upload from or download to.

2) Enter ftp sjpc.org.  The server will reply

Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.

C:\Users\pcname>ftp sjpc.org
Connected to sjpc.org.
220---------- Welcome to Pure-FTPd [TLS] ----------
220-You are user number 3 of 50 allowed.
220-Local time is now 18:37. Server port: 21.
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
 

3) Enter User as username@sjpc.org.  When prompted, enter your password.  The server will reply

User (sjpc.org:(none)): username@sjpc.org
331 User username@sjpc.org OK. Password required
Password:
230-User username@sjpc.org has group access to: sjpcbak2
230 OK. Current restricted directory is /
ftp>

4) You are logged into directory /home/username.  Directory /home/username/public_html is where you want to put your files.  To change to this directory, enter cd public_html.  To verify that you are in the right directory, enter pwd.  The server will reply

ftp> pwd
257 "/home/username/public_html" is current directory.
ftp>

Transferring Files with FTP

1) To upload an index.htm file to the server, enter put index.htm.  The server will reply
ftp> put index.htm
200 PORT command successful.
150 Opening ASCII mode data connection for index.htm
226 Transfer complete.
ftp: 1674 bytes sent in 1.00 Seconds 8000.00 Kbytes/sec.
ftp>
2)  To verify that the file is there, enter dir index.htm.  The server will reply
ftp> dir index.htm
200 PORT command successful.
150 Opening ASCII mode data connection for directory listing.
-rw-r--r--   1 500      500          1674 Dec 27  2000 index.htm
226 Transfer complete.
ftp: 66 bytes received in 0.00Seconds 66000.00Kbytes/sec.
ftp>
3) We transferred the html file in FTP's default ASCII mode.  To transfer images (.GIF, .JPG, etc) we must toggle to FTP's binary mode before doing the put.  Enter binary and the server will reply
ftp> binary
200 Type set to I.
ftp>
4) To return to ASCII mode enter ascii and the server will reply
ftp> ascii
200 Type set to A.
ftp>
5) To download index.htm from the server to your computer's default directory enter get index.htm and the server will reply
ftp> get index.htm
200 PORT command successful.
150 Opening ASCII mode data connection for index.htm (1674 bytes).
226 Transfer complete.
ftp: 1704 bytes received in 1.32Seconds 1.29Kbytes/sec.
ftp>
6) To change to a lower directory use the cd command:
ftp> cd public_html



250 CWD command successful.



ftp>
7) To change to the previous directory:
ftp> cd ..



250 CWD command successful.
8) To send a file and change it's name, use send, then reply to the prompts for the file names:
ftp> send



Local file CURRENT.HTM



Remote file current.htm



200 PORT command successful.



150 Opening ASCII mode data connection for 'current.htm'.



226 Transfer complete.



ftp: 10454 bytes sent in 1.27Seconds 8.23Kbytes/sec.
9) The send command may have the two names on the command line:
ftp> send CURRENT.HTM current.htm 



200 PORT command successful.



150 Opening ASCII mode data connection for 'current.htm'.



226 Transfer complete.



ftp: 10454 bytes sent in 1.43Seconds 7.31Kbytes/sec.



ftp>
10) If your home page ends in .html, your customer may omit it, so we should rename the file. We could have done that when using the send command. To fix it, use rename:
ftp> rename index.htm index.html



350 File exists, ready for destination name



250 RNTO command successful.



ftp>
11) You may enter rename with no operands:
ftp> rename



>From name index.htm



To name index.html



350 File exists, ready for destination name



250 RNTO command successful.



ftp>
12)  You may enter delete with no operands:
ftp> delete
Remote file index.html
250 DELE command successful.
ftp>
13) To end the session and terminate the FTP prgram, use close followed by quit:
ftp> close



221 Goodbye. 



ftp> quit



C:\COMM\WEBSITE>
The final line above is the DOS prompt.


Return to the San Jose IBM PC Club's home page