Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 93003 invoked from network); 20 May 2004 00:41:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 20 May 2004 00:41:16 -0000 Received: (qmail 57352 invoked by uid 500); 20 May 2004 00:41:48 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 57265 invoked by uid 500); 20 May 2004 00:41:47 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 57242 invoked by uid 98); 20 May 2004 00:41:47 -0000 Received: from gcjcu-commons-user@m.gmane.org by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(80.91.224.249):. Processed in 0.146882 secs); 20 May 2004 00:41:47 -0000 X-Qmail-Scanner-Mail-From: gcjcu-commons-user@m.gmane.org via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(80.91.224.249):. Processed in 0.146882 secs) Received: from unknown (HELO main.gmane.org) (80.91.224.249) by hermes.apache.org with SMTP; 20 May 2004 00:41:47 -0000 Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BQbcJ-00032F-00 for ; Thu, 20 May 2004 02:40:59 +0200 Received: from cpe00095b487581-cm00080dadec80.cpe.net.cable.rogers.com ([69.194.143.216]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 May 2004 02:40:59 +0200 Received: from spambort by cpe00095b487581-cm00080dadec80.cpe.net.cable.rogers.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 May 2004 02:40:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: commons-user@jakarta.apache.org From: "bort" Subject: [NET] FTP upload works from test environment but not production Date: Wed, 19 May 2004 20:34:06 -0400 Lines: 46 Message-ID: X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: cpe00095b487581-cm00080dadec80.cpe.net.cable.rogers.com X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Sender: news X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi all I've successfully implemented the Commons-Net package on my local Tomcat server. I am able to make a connection to a remote FTP server, and write an OutputStream to it. The code is as follows: ======= FTPClient ftp = new FTPClient(); OutputStreamWriter osw = null; try { ftp.connect(server); if (username != null && username.length() > 0) { ftp.login(username, password); } ftp.setFileType(FTP.BINARY_FILE_TYPE); ftp.enterLocalPassiveMode(); osw = new OutputStreamWriter(ftp.storeFileStream(filename)); osw.write(filecontents); osw.close(); ftp.disconnect(); } catch (Exception e) { e.printStackTrace(); } ======= Problem is that when I transfer this code to a standalone Tomcat server elsewhere, I get some peculiar behaviour. The file gets created on the FTP Server, but it has a size of 0 bytes. It seems as if the OutputStreamWriter is not sending the information out, to be written to the file. Anyone have any ideas as to why this is happening? If you need more information, please let me know. bort --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org