Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ftp server using indy

Posted on 2004-08-30
3
Medium Priority
?
745 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 1000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

963 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