Skip to content

Instantly share code, notes, and snippets.

@chakkaradeep
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chakkaradeep/b52e2f49a9d10c26a156 to your computer and use it in GitHub Desktop.
Save chakkaradeep/b52e2f49a9d10c26a156 to your computer and use it in GitHub Desktop.
Office 365 API My Files - Get File Content
public static async Task<Stream> GetFileContent(string strFileId)
{
var file = (IFileFetcher)(await _spFilesClient.Files.GetById(strFileId).ToFile().ExecuteAsync());
var streamFileContent = await file.DownloadAsync();
streamFileContent.Seek(0, System.IO.SeekOrigin.Begin);
return streamFileContent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment