Solved

ftp server using indy

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
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…

776 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