title: How to upload a folder/file on onedrive using the onedrive sdk for windows 10 UWP
body: <p>I'm trying to use the onedrive sdk to upload content with <a href="https://github.com/OneDrive/onedrive-sdk-csharp/blob/master/docs/items.md" rel="nofollow">this</a> link.</p>
  
  <p>Edit:</p>
  
  <ul>
  <li>I have permission to write files into the onedrive.</li>
  <li>I'm able to login and view the folders of the onedrive.</li>
  <li>Also the app is associated with the store.</li>
  </ul>
  
  <p>Code:</p>
  
  <pre><code>using (contentStream)
  {
      var uploadedItem = await oneDriveClient
                                   .Drive
                                   .Root
                                   .ItemWithPath("path/to/file.txt")
                                   .Content
                                   .Request()
                                   .PutAsync&lt;Item&gt;(contentStream);
  }
  </code></pre>
  
  <p>what exactly is path/to/file.txt and what is contentStream? Can someone give me a clear example as I'm getting a 'Microsoft.OneDrive.Sdk.OneDriveException'.</p>