title: How to access nextcloud files in C# by using WebDav?
body: <p>When trying to access the WebDav API of nextcloud via WinSCP, I am facing several problems with the right usage of root folder, remote path, etc. 
  To save others some time, here is the working code I came up with to upload a file into a remote (shared) folder.</p>
  
  <p>Lessons learned:</p>
  
  <ol>
  <li>server name is provided without protocol, this is defined by the
  SessionOptions.Protocol </li>
  <li>root folder may not be empty, must be at least "/" </li>
  <li>the next cloud provider / the configuration defines the root url, so "webdav" or "dav" after remote.php are predefined. Normally you can see it in the lower left corner when using the webapp of nextcloud in the settings section</li>
  <li>"files/user" or "files/username" is not necessarily required - defined by the hoster / configuration as well </li>
  <li>the connecting user must have access rights to the given directory you should provide file access permissions to others (if wanted) by providing FilePermissions in the TransferOptions</li>
  </ol>
  
  <p>However, there is no working example in the WinSCP, the nextcloud documentation, nothing to find here as well.</p>