You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "tom yang (JIRA)" <ji...@apache.org> on 2011/06/14 08:40:49 UTC

[jira] [Created] (NET-417) org.apache.commons.net.ftpFTPClient, file will not be totally transferred.

org.apache.commons.net.ftpFTPClient, file will not be totally transferred.
--------------------------------------------------------------------------

                 Key: NET-417
                 URL: https://issues.apache.org/jira/browse/NET-417
             Project: Commons Net
          Issue Type: Bug
          Components: FTP
    Affects Versions: 3.0.1
         Environment: Windows XP FTPClient program sending file to Windows 2003 IIS FTP Server
            Reporter: tom yang


If I use this ftp.storeFile(f.getName(), stream)  to transfer file to the FTP Server. After the function returned the file will be partially sent. 
E.g. If the file has 1025 bytes, only 1024 bytes will be sent while if the file has 2050 bytes, only 2048 bytes will be sent.
That's because the default buffer size is 1024, each time 1024 bytes of file content will be sent to the FTP server. But stream.flush() is not called at the end of each transfer. Finally, socket stream to FTP server will be closed before the 
last transmission and the last frame of data, which may be less than 1024, will be left unsent.

My way of fixing this BUG: Change the content of method FtpClient.__storeFile(), change the last parameter for calling Util.copyStream() to 'true'.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (NET-417) org.apache.commons.net.ftpFTPClient, file will not be totally transferred.

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/NET-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated NET-417:
---------------------

    Affects Version/s:     (was: 3.0.1)
                       3.0
               Labels:   (was: newbie)

> org.apache.commons.net.ftpFTPClient, file will not be totally transferred.
> --------------------------------------------------------------------------
>
>                 Key: NET-417
>                 URL: https://issues.apache.org/jira/browse/NET-417
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0
>         Environment: Windows XP FTPClient program sending file to Windows 2003 IIS FTP Server
>            Reporter: tom yang
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> If I use this ftp.storeFile(f.getName(), stream)  to transfer file to the FTP Server. After the function returned the file will be partially sent. 
> E.g. If the file has 1025 bytes, only 1024 bytes will be sent while if the file has 2050 bytes, only 2048 bytes will be sent.
> That's because the default buffer size is 1024, each time 1024 bytes of file content will be sent to the FTP server. But stream.flush() is not called at the end of each transfer. Finally, socket stream to FTP server will be closed before the 
> last transmission and the last frame of data, which may be less than 1024, will be left unsent.
> My way of fixing this BUG: Change the content of method FtpClient.__storeFile(), change the last parameter for calling Util.copyStream() to 'true'.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (NET-417) org.apache.commons.net.ftpFTPClient, file will not be totally transferred.

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049240#comment-13049240 ] 

Sebb commented on NET-417:
--------------------------

Are you sure you are using version 3.0.1?

The problem you describe was present in 3.0, but was fixed in 3.0.1, see NET-409.

> org.apache.commons.net.ftpFTPClient, file will not be totally transferred.
> --------------------------------------------------------------------------
>
>                 Key: NET-417
>                 URL: https://issues.apache.org/jira/browse/NET-417
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0.1
>         Environment: Windows XP FTPClient program sending file to Windows 2003 IIS FTP Server
>            Reporter: tom yang
>              Labels: newbie
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> If I use this ftp.storeFile(f.getName(), stream)  to transfer file to the FTP Server. After the function returned the file will be partially sent. 
> E.g. If the file has 1025 bytes, only 1024 bytes will be sent while if the file has 2050 bytes, only 2048 bytes will be sent.
> That's because the default buffer size is 1024, each time 1024 bytes of file content will be sent to the FTP server. But stream.flush() is not called at the end of each transfer. Finally, socket stream to FTP server will be closed before the 
> last transmission and the last frame of data, which may be less than 1024, will be left unsent.
> My way of fixing this BUG: Change the content of method FtpClient.__storeFile(), change the last parameter for calling Util.copyStream() to 'true'.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (NET-417) org.apache.commons.net.ftpFTPClient, file will not be totally transferred.

Posted by "tom yang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049542#comment-13049542 ] 

tom yang commented on NET-417:
------------------------------

Confirmed. Sorry, I've made a mistake. My version is 3.0 but not 3.0.1. 

> org.apache.commons.net.ftpFTPClient, file will not be totally transferred.
> --------------------------------------------------------------------------
>
>                 Key: NET-417
>                 URL: https://issues.apache.org/jira/browse/NET-417
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0.1
>         Environment: Windows XP FTPClient program sending file to Windows 2003 IIS FTP Server
>            Reporter: tom yang
>              Labels: newbie
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> If I use this ftp.storeFile(f.getName(), stream)  to transfer file to the FTP Server. After the function returned the file will be partially sent. 
> E.g. If the file has 1025 bytes, only 1024 bytes will be sent while if the file has 2050 bytes, only 2048 bytes will be sent.
> That's because the default buffer size is 1024, each time 1024 bytes of file content will be sent to the FTP server. But stream.flush() is not called at the end of each transfer. Finally, socket stream to FTP server will be closed before the 
> last transmission and the last frame of data, which may be less than 1024, will be left unsent.
> My way of fixing this BUG: Change the content of method FtpClient.__storeFile(), change the last parameter for calling Util.copyStream() to 'true'.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (NET-417) org.apache.commons.net.ftpFTPClient, file will not be totally transferred.

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/NET-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved NET-417.
----------------------

    Resolution: Duplicate

> org.apache.commons.net.ftpFTPClient, file will not be totally transferred.
> --------------------------------------------------------------------------
>
>                 Key: NET-417
>                 URL: https://issues.apache.org/jira/browse/NET-417
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0
>         Environment: Windows XP FTPClient program sending file to Windows 2003 IIS FTP Server
>            Reporter: tom yang
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> If I use this ftp.storeFile(f.getName(), stream)  to transfer file to the FTP Server. After the function returned the file will be partially sent. 
> E.g. If the file has 1025 bytes, only 1024 bytes will be sent while if the file has 2050 bytes, only 2048 bytes will be sent.
> That's because the default buffer size is 1024, each time 1024 bytes of file content will be sent to the FTP server. But stream.flush() is not called at the end of each transfer. Finally, socket stream to FTP server will be closed before the 
> last transmission and the last frame of data, which may be less than 1024, will be left unsent.
> My way of fixing this BUG: Change the content of method FtpClient.__storeFile(), change the last parameter for calling Util.copyStream() to 'true'.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (NET-417) org.apache.commons.net.ftpFTPClient, file will not be totally transferred.

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/NET-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb closed NET-417.
--------------------


> org.apache.commons.net.ftpFTPClient, file will not be totally transferred.
> --------------------------------------------------------------------------
>
>                 Key: NET-417
>                 URL: https://issues.apache.org/jira/browse/NET-417
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0
>         Environment: Windows XP FTPClient program sending file to Windows 2003 IIS FTP Server
>            Reporter: tom yang
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> If I use this ftp.storeFile(f.getName(), stream)  to transfer file to the FTP Server. After the function returned the file will be partially sent. 
> E.g. If the file has 1025 bytes, only 1024 bytes will be sent while if the file has 2050 bytes, only 2048 bytes will be sent.
> That's because the default buffer size is 1024, each time 1024 bytes of file content will be sent to the FTP server. But stream.flush() is not called at the end of each transfer. Finally, socket stream to FTP server will be closed before the 
> last transmission and the last frame of data, which may be less than 1024, will be left unsent.
> My way of fixing this BUG: Change the content of method FtpClient.__storeFile(), change the last parameter for calling Util.copyStream() to 'true'.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (NET-417) org.apache.commons.net.ftpFTPClient, file will not be totally transferred.

Posted by "tom yang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049556#comment-13049556 ] 

tom yang commented on NET-417:
------------------------------

My newest test proves that this problem has been fixed in 3.0.1. Thanks

> org.apache.commons.net.ftpFTPClient, file will not be totally transferred.
> --------------------------------------------------------------------------
>
>                 Key: NET-417
>                 URL: https://issues.apache.org/jira/browse/NET-417
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0.1
>         Environment: Windows XP FTPClient program sending file to Windows 2003 IIS FTP Server
>            Reporter: tom yang
>              Labels: newbie
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> If I use this ftp.storeFile(f.getName(), stream)  to transfer file to the FTP Server. After the function returned the file will be partially sent. 
> E.g. If the file has 1025 bytes, only 1024 bytes will be sent while if the file has 2050 bytes, only 2048 bytes will be sent.
> That's because the default buffer size is 1024, each time 1024 bytes of file content will be sent to the FTP server. But stream.flush() is not called at the end of each transfer. Finally, socket stream to FTP server will be closed before the 
> last transmission and the last frame of data, which may be less than 1024, will be left unsent.
> My way of fixing this BUG: Change the content of method FtpClient.__storeFile(), change the last parameter for calling Util.copyStream() to 'true'.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira