title: Sharepoint download a file in base64 using .Net Core
body: <p>I need to download a file from Sharepoint server. I was previously using Asp.net MVC and there were methods like <code>File.OpenBinaryDirect()</code>. But after adding portal library to my .net core application I am unable to find any method like <code>File.OpenBinaryDirect()</code>.</p>
  
  <pre><code>Microsoft.SharePoint.Client.ClientContext clientContext = 
      new Microsoft.SharePoint.Client.ClientContext(server);
  Microsoft.SharePoint.Client.FileInformation f = 
      Microsoft.SharePoint.Client.File.OpenBinaryDirect(clientContext, serverrelative);
  
  clientContext.ExecuteQuery();
  
  using (var fileStream = new FileStream(@"d:\prettyimage.jpg", FileMode.Create))
  f.Stream.CopyTo(fileStream);
  </code></pre>
  
  <p>What should I use now to download a file using .net core 2.2.</p>