Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 64931 invoked from network); 23 Jun 2003 09:55:26 -0000 Received: from mail.imp.ch (157.161.1.2) by daedalus.apache.org with SMTP; 23 Jun 2003 09:55:26 -0000 Received: from vbgames.ch ([157.161.192.194]) by mail.imp.ch (8.12.6p2/8.12.3) with ESMTP id h5N9tbhP076056 for ; Mon, 23 Jun 2003 11:55:38 +0200 (CEST) (envelope-from mailings@vbgames.ch) Message-ID: <3EF6CF35.3010507@vbgames.ch> Date: Mon, 23 Jun 2003 11:58:13 +0200 From: Michael Hauck MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: Commons / Net tutorial References: <20030623070109.92861.qmail@web41708.mail.yahoo.com> <3EF6C3C1.304@vbgames.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N And another email from me...I also got uploading working: private void up() { FTPClient ftp = new FTPClient(); try { ftp.connect("domain"); ftp.login("user", "pass" ); ftp.changeWorkingDirectory( "/public_html" ); ftp.setFileType(ftp.BINARY_FILE_TYPE); File file = new File("img.gif"); FileInputStream in = new FileInputStream(file); ftp.storeFile("img.gif",in); in.close(); ftp.logout(); ftp.disconnect(); } catch (Exception ex) { ex.printStackTrace(); } } mike Michael Hauck wrote: > It's me again! ;) > > I think there is an error in the ftp example code. You don't set the > type (ftp.type(ftp.BINARY_FILE_TYPE);) so all downloaded files, except > text files are corrupt. After setting this it works fine. I will now > try to upload some files. > > mike > > Steven Haines wrote: > >> Hi All, >> >> Your question leads to a request that I have for the >> group: I have written four articles that I put in the >> Java Reference Guide on InformIT.com on the Commons / >> NET classes. I already posted one on Telnet, FTP (only >> showing download - sorry Michael), and SMTP, with the >> final of the four on NNTP going up next Friday. >> So Michael, take a look at www.informit.com and go to >> the Java Reference Guide to see if my tutorials and >> sample code help. And to the rest of you, can you >> check out the articles and tell me if there is >> anything that you would like changed.. I update the >> guide every week with new content, but because I am a >> user of these classes and not a developer of them, I >> only had the Javadoc and an understanding of the >> underlying protocols to work with and could very well >> have made mistakes.. >> >> Thanks so much and I hope that these articles are >> useful for your users. Feel free to link to the site >> if you think others would benefit. There is a link >> from the resources section of the articles back to the >> Commons/NET website. >> >> Steven Haines >> >> >> --- Michael Hauck wrote: >> >> >>> Hi everyone, >>> >>> I have just downloaded commons / net and it looks >>> very powerful.I have played with the FTPClient class a little and >>> managed >>> to connect to a FTP server and list all files there. I have however >>> problems getting an further from there. Is there any documentation >>> about >>> this project? I got the Java Docs but they aren't always very helpful. >>> What I want to do next is to send a file (an image) to the server and >>> get another one from the same server. Can anyone give me some hints on >>> how to do this? Uploading and downloading simple text files works >>> fine. >>> >>> Thanks! >>> >>> mike >>> >>> >>> >>> >> >> --------------------------------------------------------------------- >> >> >>> To unsubscribe, e-mail: >>> commons-user-unsubscribe@jakarta.apache.org >>> For additional commands, e-mail: >>> commons-user-help@jakarta.apache.org >>> >>> >> >> >> >> __________________________________ >> Do you Yahoo!? >> SBC Yahoo! DSL - Now only $29.95 per month! >> http://sbc.yahoo.com >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: commons-user-help@jakarta.apache.org >> >> >> >> >> >> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > >