Solved

ftp server using indy

Posted on 2004-08-30
3
726 Views
Last Modified: 2010-04-04
I was looking for a sample code using the Indy ftp server, unfortunately no one could find one,   next,  I have tried to use the ftpserver control
and activate it.  (at run time) ;  next I try to call the ftp server (using indy ftp client example)  unfortunately I getting client error,  this is why I needed a ftpserver example to begin with.  the ftpsever looks like a simple and easy to use object (5 event; 8 fields) yet it doesn't work, I get no change of status when I activate the ftpserver, and errors when I try to connect to it.

with all respect to Indy, maybe this control was never tested.


Thanks
0
Comment
Question by:amielDorel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
BlackTigerX earned 500 total points
ID: 11936847
seems like you are confusing the TIdTrivialFTPServer with the TIdFTPServer, this last one is the one you want
you can find it in the same palette as the other one

just drop one in your form, set the Active to True, AllowAnonymous to True, run your program

you can now connect to it using anonymous as the user and email as password... and now you can play with all the events, etc
0
 

Author Comment

by:amielDorel
ID: 11941173
Thanks I was,  do you know how to set diffrent users and password using the TIdFTPServer,  can I change the port number on the server and client, what the data port for ?
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 11943089
the TIdFTPServer has various methods of accepting users, there are properties like:

AnonymousAccounts

- here you can put a list of all the users that you want to be able to login anonymous (without need for a password), is provided as a TStringList so you could load this list from a file, a database, etc... or fill it in at design time

- the "password" required for those users will only be the email (it really can be anything in the X@Y.Z form)

- Along with that property there's AllowAnonymousAccounts, set it to True to allow anonymous users

- There's also AnonymousPassStrictCheck, which Indicates that passwords for anonymous accounts must contain a valid email address.

the other way to login would be using the event OnUserLogin:

procedure TForm1.IdFTPServer1UserLogin(ASender: TIdFTPServerThread;
  const AUsername, APassword: String; var AAuthenticated: Boolean);
begin
  AAuthenticated:=True
end;

if you wanted to just allow everyone (not recommended) to your site you could use the code above, but here you are provided with the UserName and Password and you can use whatever you want to validate those (a database, a text file, etc)

Yes, you can change the port numbers, most FTP clients should allow you to change the port you want to connect, so that shouldn't be a problem
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question