 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Leo Zhang Guest
|
Posted: Mon Mar 06, 2006 1:03 am Post subject: How can I get the event when the transfer is finished in FTP |
|
|
Hi all. I'm developing a FTP server using Indy FTP Server. I want to do sth on the server as soon as the file uploading is finished. How can I capture this event? |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Mar 06, 2006 7:03 pm Post subject: Re: How can I get the event when the transfer is finished in |
|
|
"Leo Zhang" <zhangshile342 (AT) yahoo (DOT) com.cn> wrote in message
news:440b7b7f$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi all. I'm developing a FTP server using Indy FTP Server. I
want to do sth on the server as soon as the file uploading is
finished. How can I capture this event?
|
There currently is no event available for that. The only option is to
derive your own TStream class, instantiate it in the OnStoreFile event,
track what you need to while the file is being streamed, and then finally do
what you need to when the stream is being destroyed.
Gambit |
|
| Back to top |
|
 |
Leo Zhang Guest
|
Posted: Tue Mar 07, 2006 1:03 am Post subject: Re: How can I get the event when the transfer is finished in |
|
|
"Remy Lebeau \(TeamB\)" <no.spam (AT) no (DOT) spam.com> wrote:
| Quote: |
"Leo Zhang" <zhangshile342 (AT) yahoo (DOT) com.cn> wrote in message
news:440b7b7f$1 (AT) newsgroups (DOT) borland.com...
Hi all. I'm developing a FTP server using Indy FTP Server. I
want to do sth on the server as soon as the file uploading is
finished. How can I capture this event?
There currently is no event available for that. The only option is to
derive your own TStream class, instantiate it in the OnStoreFile event,
track what you need to while the file is being streamed, and then finally do
what you need to when the stream is being destroyed.
Gambit
|
I think I may get a solution. There is a property "DataChannelThread" in TIdFTPServerThread, and I can handle its OnStopped. I tried and it seemed OK.  |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Mar 07, 2006 4:03 am Post subject: Re: How can I get the event when the transfer is finished in |
|
|
"Leo Zhang" <zhangshile342 (AT) yahoo (DOT) com.cn> wrote in message
news:440cd498$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I think I may get a solution. There is a property "DataChannelThread"
in TIdFTPServerThread, and I can handle its OnStopped.
|
The only problem with that approach is that you won't be told why the thread
is being stopped. It could be for a successful transfer, but then again it
could also be for a failed transfer, as well as an aborted transfer. There
is simply no way for your even handler to know which situation is actually
the case.
Also, that approach can only be applied to Indy 9. Starting with Indy 10,
TIdFTPServer does not use separate threads to perform transfers anymore.
Gambit |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|