title: How to copy file from local to share with JCifs?
body: <p>I can copy file from share to local. But I want to switch, and copy a file from local to share.</p>
  
  <pre><code>I am trying this code:
  SmbFile oldFile = new SmbFile("c:/tmp/test.xml");
  SmbFile newFile = new SmbFile("smb://someone_pc/tmp/test.xml", new NtlmPasswordAuthentication("", username, password));
  oldFile.copyTo(newFile);
  </code></pre>
  
  <p>But I am getting an exception on <code>copyTo</code> method:</p>
  
  <pre><code>Invalid operation for workgroups or servers
  </code></pre>
  
  <p>How should I copy file from local to share?</p>