Hi,
I am evaluating Spire.xls to read xls, xlsx and csv files from stream for our ptoject. When i try to read CSV, it gives below error. It works fine for xls and xlsx. ANy hep is appreciated.
spr2718 was unhandled by user code.
An exception of type 'spr2718' occurred in Spire.XLS.dll but was not handled in user code
Additional information: Zip exception.Can't locate end of central directory record. Possible wrong file format or archive is corrupt.
private void Spiral(HttpPostedFileBase file)
{
var workbook = new Workbook();
if (file.FileName.Contains("xlsx"))
{
workbook.LoadFromStream(stream, ExcelVersion.Version2013);
}
else
{
workbook.LoadFromStream(file.InputStream);
}
Worksheet sheet = workbook.Worksheets[0];
DataTable dt = sheet.ExportDataTable();
}