title: MemoryStream to Base64 giving invalid Base64 string
body: <p>On a file upload I am converting the byte array to base64 before the database insert.  In the method below the Convert.ToBase64String() function is resulting in an invalid base64 string.  Should I be treating/validating the memory stream array before passing to the function?</p>
  
  <pre><code>using (var fileStream = file.OpenReadStream())
  using (var ms = new MemoryStream())
   {
     fileStream.CopyTo(ms);
     fileBytes = ms.ToArray();
     string s = Convert.ToBase64String(fileBytes);
     fileIn.FileData = s;
   }
  </code></pre>