I am working on a project which integrates with an API that requires certain files be base64 encoded for the upload.
I have this code below which works fine:
Code:
var data = Encoding.Default.GetBytes("CSV file here");
var base64Data = Convert.ToBase64String(data);
var finalData = Encoding.Default.GetBytes(base64Data);
but I am wondering if this is the most efficient way to achieve this?