Thanks a lot for your suggestions. I'm taking good notes of what you are proposing. I don't have control on the FTP client side so it's hard for me to ask the client to rename the file after a successful upload. I also already verify the REPLY code and it does not seem to be different when the client close the connection or abort the transfer from what it is when the connection close normally (I will re-test that more today). Regarding that, I'm a bit confuse about how the FTP protocol works. Should the client send the ABOR command to terminate an upload? From what I've seen, some client do that, but most don't.
Regards, ----------------------------------------------------------------- Sebastien Roy Solutions de sécurité d'entreprise et d'affaires électroniques (450) 681.1681 ext: 279 Toll free : (877)561.1681 ________________________________________ From: David Latorre [[email protected]] Sent: Friday, March 19, 2010 4:35 AM To: [email protected] Subject: Re: Detecting interrupted upload You should check the reply code as Niklas suggested but, besides this, we usually suggest that the client rename the file after successfully uploading it - ideally it would also check the MD5 sum of the transferred file prior to this name change. 2010/3/18 Niklas Gustavsson <[email protected]>: > On Thu, Mar 18, 2010 at 8:04 PM, Sébastien Roy <[email protected]> wrote: >> Recently, for the first time, I end up not being able to accomplish >> something. I was looking for a way to detect FTP uploads that would not >> complete normally (client close connection, network interruption, etc ...). >> My conclusion is that there is no way to detect if a transfer has completed >> normally or if the transfer has been interrupted. Did anyone has any ideas >> how it would be possible to be notified if such interruption occurs? > > From Ftplet.afterCommand, you should be able to look at the reply. For > those failed transfers that FtpServer can detect (that causes an > SocketException or IOException) this should be something like 426 or > 551. > > /niklas >
