Check out example codes for "how to convert iformfile to byte array c#". It will help you in understanding the concepts better.
Code Example 1
foreach (var file in files)
{
if (file.Length > 0)
{
using (var ms = new MemoryStream())
{
file.CopyTo(ms);
var fileBytes = ms.ToArray();
string s = Convert.ToBase64String(fileBytes);
// act on the Base64 data
}
}
}
Learn ReactJs, React Native from akashmittal.com