title: Java upload file ftp server
body: <p>I am trying to make a function in Java :</p>
  
  <pre><code>public static void upload_files(String us, String pw, String ip, String f){
   try
   {
      FTPClient client = new FTPClient();
      client.connect(ip);
      client.login(us,pw);
      client.upload(f);
   } catch(Exception e) {
      e.printStackTrace();
   }
  }
  </code></pre>
  
  <p>I added apache libraries, but sadly I got an error on "upload" line
  I suppose I do not use correctly the method upload, but I don't know how to.</p>
  
  <p>When I compile it with Netbeans, it is noticing me that there is an error line "client.upload(f);" </p>
  
  <p>The error given in output is "<em>java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: org.apache.commons.net.ftp.FTPClient.upload</em>"</p>
  
  <p>Thank you all in advance.
  nb : "f" is the direct path to my file</p>
  
  <hr>
  
  <p>EDIT :</p>
  
  <p>The problem is "quite" solved since now I upload some files on my ftp server BUT sadly they are all empty, as noticed on below.</p>