Home arrow Delphi-Kylix arrow FTP Server: The Theory
DELPHI-KYLIX

FTP Server: The Theory


In this two part series about FTP we are going to look at what an FTP server is and what it is used for. The first part will cover the theory and the second part will put all the theory into practice; it's where we will actually implement an FTP server. I'm doing the theory first to give you a bit of background about the FTP protocol. This will make it easy for you to understand the purpose of each command in the protocol as well as how to implement them in the next article.

Author Info:
By: Leidago
Rating: 5 stars5 stars5 stars5 stars5 stars / 16
January 29, 2007
TABLE OF CONTENTS:
  1. · FTP Server: The Theory
  2. · Explaining the Exchange
  3. · FTP Commands
  4. · Access Control Commands
  5. · Commands That Manipulate

print this article
SEARCH DEVARTICLES

FTP Server: The Theory
(Page 1 of 5 )

What you will need

Delphi 7 and higher, Indy10.1.15 or higher and lots and lots of enthusiasm.

What is an FTP Server?

An FTP server handles the process of transferring files from one computer to another.  The FTP protocol defines how FTP programs should work together when sharing files. It uses the client/server model in its implementation. This means that in order to use an FTP server, you will need an FTP client. In most cases the FTP server program offers files to the client program, but it also makes provision for the client to upload files.

As with all protocols that uses the client server model, the process of sending and receiving files is done through the request/response method and involves commands. The client usually makes the request and the server responds. In order for a client to connect to a server, the FTP server application needs to be active and listening on a port. An FTP server usually runs on port number 21.

When an FTP client connects to an FTP server it uses a username and password to help make the process secure. There is also an option to enable anonymous access to an FTP server, where an FTP client does not need a valid username or password. The communication between the FTP client and the FTP server is in plain text and uses reply codes as defined by the FTP protocol.  Here’s an example communication between an FTP client and FTP server:

Server: 220 Welcome to my Indy FTP Server ready.

Client: user myusername

Server: 331 User name okay, need password.

Client: pass mypassword

Server: 230 User logged in, proceed.

Client: Help

Server: 500 'Help': command not understood.

Client: Help

214-The following commands are recognized (* => unimplemented, + => extension).

214-    ABOR      EPSV      MLSD      NOOP      RETR      STOR      XPWD

214-    ACCT*     FEAT      MLST      OPTS      RMD       STOU

214-    ALLO      HELP      MODE      PASS      RNFR      STRU

214-    APPE      LIST      MRCP*     PASV      RNTO      SYST

214-    CDUP      MAIL*     MRSQ*     PORT      SITE      TYPE

214-    CLNT      MDTM      MSAM*     PWD       SIZE      USER

214-    CWD       MFCT      MSND*     QUIT      SMNT      XCUP

214-    DELE      MKD       MSOM*     REIN      SPSV      XCWD

214-    EPRT      MLFL*     NLST      REST      STAT      XMKD

214


blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials