using System; using System.IO; namespace customExcel { public class ExcelSaver { public static void SaveBase64ExcelFile(string base64ExcelData, string outputPath) { try { // Decode the Base64 string to a byte array byte[] excelBytes = Convert.FromBase64String(base64ExcelData); // Write the byte array to a file with the appropriate Excel file extension File.WriteAllBytes(outputPath, excelBytes); } catch (Exception ex) { // Handle exceptions as needed Console.WriteLine("Error saving Excel file: " + ex.Message); } } } }