title: Write/upload a file using Samba/JCIFS issue (SmbAuthException: Access is denied)
body: <p>So I'm trying to write a file from android device to windows shared folder. I'm using latest version of JCIFS and <a href="https://stackoverflow.com/questions/9389366/how-to-access-share-folder-in-windows-through-android-and-read-files">code which displays available network shares</a> works fine. So I assume everything is ok with JCIFS and with my LAN, WiFi etc. Here is the code for file upload (actually I just want to write a text Sring to a File):</p>
  
  <pre><code>    public boolean save2Samba(String text, String fileName) {
          try {
  
              // My Windows shares doesn't require any login/password
              // String name="login";//my windows username
              // String password="password1";//my windows password
  
              // sSambaFolder contains a path like MYPC/E/SharedFolderName/
              String url = "smb://" + sSambaFolder.toLowerCase()+fileName;
  
              SmbFile file = null;
              try {
                  // assume ANONYMOUS is my case but there is no description of this in JCIFS API
                  NtlmPasswordAuthentication auth = NtlmPasswordAuthentication.ANONYMOUS;
                  file = new SmbFile(url, auth);
                  android.util.Log.i("TestApp",url);
                  // output is like smb://mypc/e/sharedfoldername/file.txt;
                  SmbFileOutputStream out = new SmbFileOutputStream(file);
                  out.write(text.getBytes());
                  out.flush();
                  out.close();
  
              } catch (Exception e) {
                  e.printStackTrace();
                  return false;
              }
  
              return true;
          } catch (Exception e) {
              e.printStackTrace();
              return false;
          }
      }
  </code></pre>
  
  <p>Since the url is logged I'm sure it is correct (also I checked the url using the code I mentioned above and it browses the folder's contain).<br>
  But the problem is Im always getting the same: </p>
  
  <pre><code>W/System.err(3214): jcifs.smb.SmbAuthException: Access is denied.
  </code></pre>
  
  <p>Shares are not password protected, so I don't need any username/password to get access. I could read/write/delete files from another WinPC and no authorization is required. Also I tried to create a password for user on WinPC with shares but result was the same. So I tried several versions of NtlmPasswordAuthentication with no luck:</p>
  
  <pre><code>NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("");
  NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(":");
  NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("Administrator:"); //actual username on WinPC with shares
  NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("Administrator");
  NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null,"Administrator","");
  NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null,"","");
  </code></pre>
  
  <p>So what am I doing wrong and how to achive my goal when there is no auth is required to get access to shared folder?<br>BTW my Samsung TV which is linux based and uses samba client is accessing the same shared folder with no problem and plays MP3 from there (well, yes, it reads only). Since my AOS device is accessing my LAN via WiFi (instead of TV which is connected via Ethernet) I also checked access to shared folder using notebook+WiFi and found no problems.<br>
  <strong>Added:</strong><br>
  I'm trying now to execute following lines:</p>
  
  <pre><code>file = new SmbFile(url, auth);
  android.util.Log.i("save2Samba", "file.exists(): " + file.exists());
  </code></pre>
  
  <p>and getting the same Access denied. I'm not even trying to write file...</p>