title: Getting an error while FTP file using FTPClient
body: <p>I am getting following exception while ftp file over to some other machine.</p>
  
  <pre><code>org.apache.commons.net.io.CopyStreamException: IOException caught while copying.
      at org.apache.commons.net.io.Util.copyStream(Util.java:119)
      at org.apache.commons.net.io.Util.copyStream(Util.java:151)
      at org.apache.commons.net.io.Util.copyStream(Util.java:162)
      at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:373)
      at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1360)
      at com.fs.ftp.FTPUsingFTPClientApache.startFTP(FTPUsingFTPClientApache.java:40)
      at com.fs.ftp.FTPUsingFTPClientApache.main(FTPUsingFTPClientApache.java:17)
  </code></pre>
  
  <p>The Code that i am using for FTP is something like :-</p>
  
  <pre><code>FTPClient ftpClient = new FTPClient();
  ftpClient.connect("home.abc.com");
  ftpClient.login("remote", "guesst12");
  int replyCode = ftpClient.getReplyCode();
  if(FTPReply.isPositiveCompletion(replyCode)) {
      System.out.println("Connection proper");
  }
  
  if(ftpClient.changeWorkingDirectory("share")) {
      System.out.println("Directory Change Succesfull");
  }
  InputStream input = new FileInputStream(new File("H:/testFile.txt"));
  BufferedInputStream inputStrean = new BufferedInputStream(input);
  if(ftpClient.storeFile("testFile.txt", input)) {
      System.out.println("File Stored Successfully");
  }
  input.close();
  inputStrean.close();
  ftpClient.logout();
  ftpClient.disconnect();
  </code></pre>
  
  <p>The above exception i get at line <code>ftpClient.storeFile("testFile.txt", input)</code>.</p>
  
  <p>Am i missing something, or using it not the correct way.</p>
  
  <p>Thanks</p>