OneDrive / onedrive-sdk-csharp

OneDrive SDK for C#! https://dev.onedrive.com
Other
294 stars 143 forks source link

Upload large file raise Unsupported segment type #239

Closed m4ss1m0g closed 4 years ago

m4ss1m0g commented 6 years ago

I used the code for Chunked Upload but with no luck,

I've tried:

var uploadPath= "MyFile.exe";
var session = await oneDriveClient
                    .Drive
                    .Root
                    .ItemWithPath(uploadPath)
                    .CreateSession()
                    .Request()
                    .PostAsync();

Also I tried

var session = await oneDriveClient
                     .ItemWithPath(uploadPath)
                     .CreateSession()
                     .Request()
                     .PostAsync();

But every time I got and Error

Unsupported segment type. ODataQuery: users/xxxxxx@yyyyy.onmicrosoft.com/drive/root/zzzzz/oneDrive.createSession

The "classic" upload work correctly.

I use Bearer Token with custom IAuthenticationProvider where the token came from App auth with delegate permissions

oatsoda commented 6 years ago

It looks like this only affects OneDrive for Business - it works fine for Consumer OneDrive.