G.Sharma
G.Sharma

Reputation: 31

Upload files to a specific folder on Onedrive in web application

I want to upload files to a specific folder on my onedrive using C# in web application. I am not able to find any sdk for that. All i can find is sdk for windows phone application. Thanks you in advance.

Upvotes: 2

Views: 1308

Answers (1)

Ryan Gregg
Ryan Gregg

Reputation: 2035

The OneDrive SDK is still valid for use in any .NET language/platform, including ASP.NET.

For web-based applications, you'll need to handle authentication yourself though. Because of the various ways of authentication a web app, the SDK didn't provide a prescriptive authentication solution for web apps.

You can either code the OAuth 2 implementation or use an existing library to connect it up (like using OWIN). Once you have an access token for OneDrive, you can provide the token to the SDK and then use the SDK as normal.

The webhook sample project in the OneDrive org has an example of how to provide an access token directly to the OneDrive SDK by way of creating a OneDriveAccountServiceProvider.

Upvotes: 1

Related Questions