I have a byte array of data in a MemoryStream and I’m trying to get Aspose.Cells to read it, but it keeps failing, even though with this same file a regular FileStream will work. I’ve attached the spreadsheet I’m using. The error that’s bubbling up is:
Cannot read that as a ZipFile ----> . : Bad signature (0xBDBFEFBD) at position 0x00001F1C
Code:
var data = File.OpenRead(“D:\temp\importtemp\1.import.xlsx”);
I think you’re not understanding the real issue. Maybe I didn’t explain it well enough.
I have a byte array of data stored in the DB. For the purposes of this example I was using a FileStream to open a file and then convert it to a MemoryStream to mimic what we’d have in production: a byte array with out a FileStream.
That byte array of data needs to be converted to a MemoryStream, which Aspose.Cells should accept. However, it doesn’t work.
If you use my example, you’ll see that it doesn’t. Please explain if I’m doing something wrong here or if there’s a bug in Aspose.Cells that doesn’t handle MemoryStreams correctly.