I want to read Excel file from JSON data which I am sending from ARC, Can anyone help me to sorted out?
public bool ControlAttachment(AttachmentFile file)
{
    try
    {
        if (file != null && file.File != null)
        {
            string xlsfile = file.File;
            string [] xls = {"application/excel","application/vnd.msexcel","xls","xlsx","application/vnd.ms-excel",};
            if (xls.ToList().Contains(file.FileType.Trim()))
            {
                file.FileType = ".xls";
                byte[] contents = Convert.FromBase64String(xlsfile);
                string LogFilePaths = ConfigurationManager.AppSettings["ExcelMapperPath"];
                string fileName = file.FileName.Split('.')[0] + file.FileType;
                string LogFile = HttpContext.Current.Server.MapPath(LogFilePaths + file.FileName.Split('.')[0] + file.FileType);
                System.IO.File.WriteAllBytes(LogFile, contents);
                if (!File.Exists(LogFile))
                { 
                    File.Create(LogFile).Dispose();
                }
                MemoryStream ms = new MemoryStream();
                using (var fs = new FileStream(LogFile, FileMode.Open, FileAccess.Write))
                { 
                        ms.CopyTo(fs);
                        ms.Dispose();
                }
            }
        }
        return true;
    }
    catch 
    {
        return false;
    }
}
 
    