title: Ftp client cannot transfer file using IPV6
body: <p>I am writing java code to send file through ftp as followed. The server that i used is FileZilla Server software at localhost.</p>
  
  <pre><code>    public static void main(String[] args) {
      try {
          String host = "fe80::21a:a0ff:fe8d:fe63"; //No problem if ipv4
          int port = 1998;
          String username = "joe";
          String password = "123";
          String directory = "D:/ftp_share";
          File fileToTransfer = new File("D:/RND/samplefile.txt");
          String fileName = fileToTransfer.getName();
          FTPClient ftp = new FTPClient();
          ftp.connect(host, port);
          ftp.login(username, password);
          FileInputStream in = new FileInputStream(fileToTransfer);
          if (!(directory == null || "".equals(directory))) {
              ftp.changeWorkingDirectory(directory);
          }
          ftp.setFileType(FTP.BINARY_FILE_TYPE);
          ftp.appendFile(fileName, (InputStream) in);
          System.out.println("File " + fileName + " succesfully sent via ftp to " + host + " at port " + port);
  
      } catch (SocketException ex) {
          Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
      } catch (IOException ex) {
          Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
      }
  }
  </code></pre>
  
  <p>The problem is i can only send through IPV4 but not using IPv6. The java exeption is</p>
  
  <pre><code>org.apache.commons.net.ftp.FTPConnectionClosedException: FTP response 421 received.  Server closed connection.
      at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:360)
      at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:290)
      at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:474)
      at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:547)
      at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:680)
      at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:551)
      at org.apache.commons.net.ftp.FTPClient.appendFile(FTPClient.java:1765)
      at rnd.Main.main(Main.java:44)
  </code></pre>
  
  <p>and the message in the file zilla server is </p>
  
  <pre><code>(000018)10/18/2011 14:46:39 PM - (not logged in) (fe80::21a:a0ff:fe8d:fe63)&gt; Connected, sending welcome message...
  (000018)10/18/2011 14:46:39 PM - (not logged in) (fe80::21a:a0ff:fe8d:fe63)&gt; 220-FileZilla Server version 0.9.39 beta
  (000018)10/18/2011 14:46:39 PM - (not logged in) (fe80::21a:a0ff:fe8d:fe63)&gt; 220-written by Tim Kosse (Tim.Kosse@gmx.de)
  (000018)10/18/2011 14:46:39 PM - (not logged in) (fe80::21a:a0ff:fe8d:fe63)&gt; 220 Please visit http://sourceforge.net/projects/filezilla/
  (000018)10/18/2011 14:46:39 PM - (not logged in) (fe80::21a:a0ff:fe8d:fe63)&gt; USER joe
  (000018)10/18/2011 14:46:39 PM - (not logged in) (fe80::21a:a0ff:fe8d:fe63)&gt; 331 Password required for joe
  (000018)10/18/2011 14:46:39 PM - (not logged in) (fe80::21a:a0ff:fe8d:fe63)&gt; PASS ***
  (000018)10/18/2011 14:46:39 PM - joe (fe80::21a:a0ff:fe8d:fe63)&gt; 230 Logged on
  (000018)10/18/2011 14:46:39 PM - joe (fe80::21a:a0ff:fe8d:fe63)&gt; CWD D:/RND/ftp_share
  (000018)10/18/2011 14:46:39 PM - joe (fe80::21a:a0ff:fe8d:fe63)&gt; 550 CWD failed. "/D:/RND/ftp_share": directory not found.
  (000018)10/18/2011 14:46:39 PM - joe (fe80::21a:a0ff:fe8d:fe63)&gt; TYPE I
  (000018)10/18/2011 14:46:39 PM - joe (fe80::21a:a0ff:fe8d:fe63)&gt; 200 Type set to I
  (000018)10/18/2011 14:46:39 PM - joe (fe80::21a:a0ff:fe8d:fe63)&gt; EPRT |1|0.0.0.0|2885|
  (000018)10/18/2011 14:46:39 PM - joe (fe80::21a:a0ff:fe8d:fe63)&gt; 200 Port command successful
  (000018)10/18/2011 14:46:39 PM - joe (fe80::21a:a0ff:fe8d:fe63)&gt; APPE jawapannya.txt
  (000018)10/18/2011 14:46:39 PM - joe (fe80::21a:a0ff:fe8d:fe63)&gt; 421 Can't create socket
  </code></pre>
  
  <p>Can any 1 help how to make it possible to send using IPV6.</p>
  
  <p>Note : I already have IPV6 in my local.</p>