Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3BE756798 for ; Wed, 15 Jun 2011 01:07:11 +0000 (UTC) Received: (qmail 62449 invoked by uid 500); 15 Jun 2011 01:07:10 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 62371 invoked by uid 500); 15 Jun 2011 01:07:10 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 62363 invoked by uid 99); 15 Jun 2011 01:07:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2011 01:07:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2011 01:07:08 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 6312F417E7F for ; Wed, 15 Jun 2011 01:06:47 +0000 (UTC) Date: Wed, 15 Jun 2011 01:06:47 +0000 (UTC) From: "tom yang (JIRA)" To: issues@commons.apache.org Message-ID: <180273156.5381.1308100007402.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2076144972.1811.1308033649828.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (NET-417) org.apache.commons.net.ftpFTPClient, file will not be totally transferred. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on 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