"C# graph api upload file one drive" Code Answer's
You're definitely familiar with the best coding language C# that developers use to develop their projects and they get all their queries like "C# graph api upload file one drive" answered properly. Developers are finding an appropriate answer about C# graph api upload file one drive related to the C# coding language. By visiting this online portal developers get answers concerning C# codes question like C# graph api upload file one drive. Enter your desired code related query in the search bar and get every piece of information about C# code related question on C# graph api upload file one drive.
C# graph api upload file one drive
/// <summary>
/// Take a file and upload it to the service
/// </summary>
/// <param name="fileToUpload">The file that we want to upload</param>
/// <param name="uploadToSharePoint">Should we upload to SharePoint or OneDrive?</param>
public async Task UploadSmallFile(StorageFile fileToUpload, bool uploadToSharePoint)
{
Stream fileStream = (await fileToUpload.OpenReadAsync()).AsStreamForRead();
DriveItem uploadedFile = null;
// Do we want OneDrive for Business/Consumer or do we want a SharePoint Site?
if (uploadToSharePoint)
{
uploadedFile = await graphClient.Sites["root"].Drive.Root.ItemWithPath(fileToUpload.Name).Content.Request().PutAsync<DriveItem>(fileStream);
}
else
{
uploadedFile = await graphClient.Me.Drive.Root.ItemWithPath(fileToUpload.Name).Content.Request().PutAsync<DriveItem>(fileStream);
}
}
Source: developer.microsoft.com
All those coders who are working on the C# based application and are stuck on C# graph api upload file one drive can get a collection of related answers to their query. Programmers need to enter their query on C# graph api upload file one drive related to C# code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about C# graph api upload file one drive for the programmers working on C# code while coding their module. Coders are also allowed to rectify already present answers of C# graph api upload file one drive while working on the C# language code. Developers can add up suggestions if they deem fit any other answer relating to "C# graph api upload file one drive". Visit this developer's friendly online web community, CodeProZone, and get your queries like C# graph api upload file one drive resolved professionally and stay updated to the latest C# updates.