commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Krah <>
Subject Re: [NET] FTP Client not fetching file with german umclaut characheters
Date Fri, 15 Jun 2012 12:45:15 GMT
You must be careful at which time in the "ftp process" you issue a
command (the javadoc of most methods does tell this).

E.g. setting control encoding or UTF-8 auto detection must be done
before "connect" is called -  because of that it does fail in your case;
the socket is already opened and setup is done in your example and you
are calling things "too late" to have an effect.

I did used you code and changed things like this:

    FTPClient ftp = new FTPClient();
    ftp.login("xx", "xx");


    String resource = "sozial-fähigen-Anwendungen.txt";
    InputStream is = ftp.retrieveFileStream(resource);
    reply = ftp.getReplyCode();
    if (!FTPReply.isPositiveCompletion(reply) && reply !=
      System.out.println("Reply===>" + reply);
      if(is != null) {


console output:

Connected to $HOST.
200 Switching to Binary mode.
Change dir ok: true
Stream1 status: 226 Transfer complete.

Used commons-net-3.0.1 for this example.

Give this a try and report if it does work for you now too :-D.

kind regards


View raw message