Free Support Forum - aspose.com

Input stream format detection


I’m using Aspose.Cells to open Excel workbooks from a stream. naturally i’m using the workbook’s open(stream) method, without specifying the format, hoping the library would detect it for me and behave accordingly.

Well, sometimes it works and sometimes it doesn’t. One example of such a failure is when the input stream’s format is HTML. in fact, when i DO specify that in the open command, it works fine.

Is there a way to reliably detect the format of an input stream?

Thank you

Hi,

Well, you need to specify FileFormatType.HTML when you streaming the html file. e.g
workbook.open(stream; FileFormatType.HTML);

And, we will check if you can support to auto-detect file format type streaming the html file. We will get back to you soon.

Thank you.


Thanks a lot. i’ll certainly wait for that. However, i would appreciate if you would support auto-detection for all format, not just HTML.

Thanks again


Hi,

We have logged your feature request (Auto-detect file format type streaming the html file) into our issue tracking system with an issue id: CELLSJAVA-13551.

We will keep you updated about it when it is implemented.

Thank you.

Hi,

Please try the attached version.

Now, the following file formats can be auto-detected by
Workbook.open(String)/open(InputStream) method:
EXCEL97TO2003, EXCEL2007/EXCEL2007XLSM/EXCEL2007XLTM/EXCEL2007XLTX, ODS, SPREADSHEETML, HTML.

Thank you.

The issues you have found earlier (filed as 13551) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.