title: upload file/directory with ftp
body: <p>I have setup openssh server in ububntu machine.
  I want to upload file and dierctory to ftp server using java api's.
  So, far i have used two different vendors java api's(jscape, zehon) to upload  file/directory.</p>
  
  <p>I am able to upload file/directory from local machine to local ftp server.
  But i am not able to upload from local machine to remote ftp server using api's.
  But with command line tools like scp or ftp or sftp i am able to upload file/directory from any local machine to remote ftp server.</p>
  
  <p>I am confused whether i have not installed/configured openssh server properly.
  or may be i am not able to use (zehon/jscape)java api's correctly.</p>
  
  <p>can u please give me a test code to upoad file and directory using java api.</p>
  
  <p>this is the code which i have used to upload file from local machine to remote ftp server.
  I am using sftp.jar from jscape.</p>
  
  <pre><code>Ftp ftp = new Ftp(hostname,username,password);
  ftp.connect();
  ftp.setDir(destFolder);
  ftp.upload(new File("local file path...");
  ftp.disconnect();
  </code></pre>
  
  <p>Thanks in advance.</p>