Thanks for that Chris. I realised what I had said just as we pulled onto site
this morning and have spent hours today calling myself all of the names
under the sun and bewailing (good word) the fact that I could not get to a
PC!! Of course you are correct, the xml is zipped so there will be no xml
header at the start of the file. That will teach me to show off before I
have had two cups of tea in the morning; my apologies to all.
Yours
Mark B
ChrisLott wrote:
>
> 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]
>
>
>
--
View this message in context:
http://old.nabble.com/Determine-version-of-excel-file-tp26603831p26611823.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]