How to upload file to onedrive and share it with REST API using web application

This sample demoed how to upload file to one drive and get a share link to share with REST using web application.

C# (996.8 KB)
5 Star
2,783 times
Add to favorites
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Dont we need any tenantId?
    1 Posts | Last post May 25, 2019
    • Am getting below error after doing the configuration mentioned in the document.
      unauthorized_client: The client does not exist or is not enabled for consumers. If you are the application developer, configure a new application through the App Registrations in the Azure Portal at
  • got an error
    1 Posts | Last post May 20, 2019
    • Got the error "The remote server returned an error: (400) Bad Request."
      from the this "public async Task<string> GetResponseStringAsync()"
      Anyone know the solution?
  • Must update the Tutorial
    1 Posts | Last post April 06, 2019
    • Hello, this messages appears:
      "We recommend registering and managing converged applications by using the App registrations (Preview) experience in the Azure Portal". So, the displays and the subsequents procedures have changed, I'm right?
  • How to upload a file to microsoftonline not to
    1 Posts | Last post September 18, 2018
    • I Tried above application , its perfectly works when try to upload a file to a personal account.But I need to upload file in business account like
      Please help me to complete the application
  • Bad Request Issues
    2 Posts | Last post March 02, 2018
    • This is really useful code to understand how OneDrive works.  I followed all the directions and can authenticate with OneDrive but no matter what I do, it says 400 Bad Request when I try to upload a file.  Has anyone else reported this issue, and can someone help to point me in the right direction?
    • Hi Scotti...i got the same you know how to fix it
  • Different user folders
    1 Posts | Last post April 24, 2017
    • Do you have an example of authenticating with an administrator level account with access to all of a company's OneDrive users and uploading to multiple users based upon their ID?