You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
787 B
24 lines
787 B
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|