Home arrow Delphi-Kylix arrow Page 2 - 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: 4 stars4 stars4 stars4 stars4 stars / 6
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

TOOLS YOU CAN USE

advertisement
FTP Server: The Theory - Explaining the Exchange
(Page 2 of 5 )

I’m using telnet (acting as the FTP client in this case) to access the FTP server that I created. As you can see, the server sends a welcome message to the client before authentication. I then typed the command “user” and gave my dummy username “myusername.” The server responded by saying “user name okay, need password.” I then typed the command “pass” and entered my dummy password which is “mypassword.” The password was accepted and gave me access to the FTP server. You can see from this communication that the server uses different numbers depending on the message. Below are some of the codes as defined in RFC 959:

200 Command okay.

500 Syntax error, command unrecognized.

This may include errors such as command line too long.

501 Syntax error in parameters or arguments.

202 Command not implemented, superfluous at this site.

502 Command not implemented.

503 Bad sequence of commands.

504 Command not implemented for that parameter.

230 User logged in, proceed.

530 Not logged in.

331 User name okay, need password.

332 Need account for login.

532 Need account for storing files.

I haven't listed all the reply codes, but as you can see from the above, they are very easy to understand. For a fuller explanation of these codes, consult the RFC 959.

We already stated that an FTP server makes files available to the FTP client. Well, that is one function of an FTP server. In addition to that, the FTP server also enables a user to manipulate these files. For example, you can download, move, delete, rename and upload files. You can also get information about a file such as its last modified date or its size. All of this is achieved through commands. For example, to look at all the files in a directory you will need to call the LIST command, or to get a file from the server you call the RETR command.


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...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



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