Discussion:
IdFTPServer Implementation basics
(too old to reply)
MuZZy
2003-11-21 17:39:06 UTC
Permalink
Hello everybody!

My boss just gave me the task to make a simple FTP Server, so i started looking at Indy IdFTPServer. The problem is there are no examples on using FTP server on Indy web site, so i have no idea where to start.

What i've already done is i put a IdFTPServer and IdUserManager components on the form :=) and in UserManager i created an "anonymous" user.

First problem is how to set the home folder and accesible folders for a user. After i pass that problem, i guess i would be able to move forward myself.

So if anybody could give me an example or just an advise,
i would HIGHLY appreciate that!

P.S. As i understand, i need to handle users' threads to set any folders, but when do i get a thread for the user?

Thank you,
Andrey
Stephan St-Denis
2003-11-21 18:56:37 UTC
Permalink
Andrey,


Don't reinvent the wheel. You may download very good FTP servers, written in
Delphi, for free. Take a look at WebWeaver (do a google search). It's a HTTP
and FTP server at the same time. You're not obliged to start both servers.

You'll also find a good FTP sample if you download Indy's demos from :

http://groups.yahoo.com/group/Indy-Demos/

HTH,

Stephan
Post by MuZZy
Hello everybody!
My boss just gave me the task to make a simple FTP Server, so i started
looking at Indy IdFTPServer. The problem is there are no examples on using
FTP server on Indy web site, so i have no idea where to start.
Post by MuZZy
What i've already done is i put a IdFTPServer and IdUserManager components
on the form :=) and in UserManager i created an "anonymous" user.
Post by MuZZy
First problem is how to set the home folder and accesible folders for a
user. After i pass that problem, i guess i would be able to move forward
myself.
Post by MuZZy
So if anybody could give me an example or just an advise,
i would HIGHLY appreciate that!
P.S. As i understand, i need to handle users' threads to set any folders,
but when do i get a thread for the user?
Post by MuZZy
Thank you,
Andrey
MuZZy
2003-11-21 19:01:33 UTC
Permalink
Thank you Stephan,
I will have a look at the examples.
Andrey
Post by Stephan St-Denis
Andrey,
Don't reinvent the wheel. You may download very good FTP servers, written in
Delphi, for free. Take a look at WebWeaver (do a google search). It's a HTTP
and FTP server at the same time. You're not obliged to start both servers.
http://groups.yahoo.com/group/Indy-Demos/
HTH,
Stephan
Post by MuZZy
Hello everybody!
My boss just gave me the task to make a simple FTP Server, so i started
looking at Indy IdFTPServer. The problem is there are no examples on using
FTP server on Indy web site, so i have no idea where to start.
Post by MuZZy
What i've already done is i put a IdFTPServer and IdUserManager components
on the form :=) and in UserManager i created an "anonymous" user.
Post by MuZZy
First problem is how to set the home folder and accesible folders for a
user. After i pass that problem, i guess i would be able to move forward
myself.
Post by MuZZy
So if anybody could give me an example or just an advise,
i would HIGHLY appreciate that!
P.S. As i understand, i need to handle users' threads to set any folders,
but when do i get a thread for the user?
Post by MuZZy
Thank you,
Andrey
Remy Lebeau (TeamB)
2003-11-21 20:57:09 UTC
Permalink
Post by MuZZy
First problem is how to set the home folder and accesible folders for a
user.

Use the server's OnAfterUserLogin event to update the properties of the
provided TIdFTPServerThread instance. You can then use those properties in
the other event handlers as needed, such as OnListDirectory and
OnRetreive/StoreFile, to determine which paths are being worked with.
TIdFTPServer does not manage the paths for you, it only parses the string
values according to client requests, but you may still have to do some of
your own parsing as well. For example, if the OnListDirectory event is
triggered and its APath parameter value starts with "/", you would have to
manualy determine where "/" actually refers to, such as substituting "/"
with the value you stored in the thread's HomeDir property in the
OnAfterUserLogin event.
Post by MuZZy
P.S. As i understand, i need to handle users' threads to set any folders,
but
Post by MuZZy
when do i get a thread for the user?
When the client connects, a thread is automatically started for it. All of
the event handlers that process client commands have an AThread parameter
that is a pointer to the particular client thread that is triggering the
event.


Gambit

Loading...