Код: Выделить всё
public async Task UploadFileToOneDriveAsync(Stream fileStream, string UserId, string folderName, string fileName)
{
var uploadPath = string.IsNullOrEmpty(folderName) ? $"/{fileName}" :$"/{folderName}/{fileName}";
await _graphClient.Users[UserId].Drive
.Root
.ItemWithPath(uploadPath)
.Content
.Request()
.PutAsync(fileStream);
}
Один из них
Код: Выделить всё
await _graphClient.Users[UserId].Drive
.Root
.ItemWithPath(uploadPath)
.Content
.Request()
.PutAsync(fileStream);
Код: Выделить всё
await _graphClient.Users[UserId].Drive.Items["root"]
.ItemWithPath(uploadPath)
.Content
.Request()
.PutAsync(fileStream);
Я использую приведенные ниже ссылки на пакеты
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/790 ... requestbui