Yes, in theory, an FTP client should send an ABORt command to hint the
server that it is aborting the previous operation, if any is in
progress. As you said, not all FTP clients do this or all FTP servers
handle the ABORt command in a good way. If the client just closes the
data socket when you click on the Abort button, FTP Server would think
that it is the end of the file and does not raise any error.

Also, I was looking at the code in the ABOR command in the server. It
appears that it still sends a 226 message after aborting the data
transfer. I'm not sure if this is the correct behavior, but will let
some one else answer this.

Regards,
Sai Pullabhotla





On Fri, Mar 19, 2010 at 8:36 AM, Sébastien Roy <s...@okiok.com> wrote:
> 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 [dvl...@gmail.com]
> Sent: Friday, March 19, 2010 4:35 AM
> To: ftpserver-users@mina.apache.org
> 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 <nik...@protocol7.com>:
>> On Thu, Mar 18, 2010 at 8:04 PM, Sébastien Roy <s...@okiok.com> 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
>>

Reply via email to