MSB wrote:
..
Finally, you could open an InputStream onto the file and examine the first
few bytes - I think it is safe to assume that the xml header would be the
first thing you read from an OpenXML based file.

Goodness, no! :-) An xlsx file (like a docx file and I suppose a pptx file) is actually a zip archive. Try opening it with winzip or your favorite zip-file reader and you'll see ("zip -T sheet.xlsx"). Inside you'll see XML files, each of which should have a nice XML header. I suppose you could reimplement the magic-number check for a zip file done by a unix/linux machine's "file" program, maybe that's what POI's WorkbookFactory does under the covers.

chris...

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to