You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading a old Microsoft Office file into a stream or byte array, the GetFileType() resulting MimeType is doc,ppt,xls, not the expect xls or doc.
For example. Both text fail.
[Fact]
public void CanReadExcelFileFromByteArray()
{
var result = File.ReadAllBytes("./data/Documents/XlsExcel2007.xls").GetFileType();
Assert.NotNull(result);
Assert.Equal(MimeTypes.EXCEL, result);
}
[Fact]
public void CanReadExcelFileFromStream()
{
using (FileStream stream = File.Open("./data/Documents/XlsExcel2007.xls", FileMode.Open))
{
var result = stream.GetFileType(false, true);
Assert.NotNull(result);
Assert.Equal(MimeTypes.EXCEL, result);
}
}
Any ideas how to get this to work without having to save the files to disk and then loading them using the FileInfo object?
The text was updated successfully, but these errors were encountered:
When loading a old Microsoft Office file into a stream or byte array, the GetFileType() resulting MimeType is doc,ppt,xls, not the expect xls or doc.
For example. Both text fail.
Any ideas how to get this to work without having to save the files to disk and then loading them using the FileInfo object?
The text was updated successfully, but these errors were encountered: