Solved

ftp server using indy

Posted on 2004-08-30
3
703 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now